strikedamic Posted November 13, 2007 Posted November 13, 2007 Hey all I'm currently building a site with an oscommerce shop as one of the pages. The shop is located at [root]/shop/osc. I'm abusing a blog as the front page of the site (I altered its PHP code so it doesn't just look "bloggy"). In the right sidebar, I'd like to inlcude a "New Product" box like I have on the shop. The frontpage is located at [root]/blog/wordpress, sidebars are being controlled with sidebar.php . What code do I have to include in the box (in the blog) to make it show the most recent product, like in the shop itself? Thank you.
knott Posted November 16, 2007 Posted November 16, 2007 Hi, Just done this myself... several different ways the contrib osc anywhere is one - however I don't think its great for searchengines - install it & view the source of the page... no links to follow. Here is roughly how I did it (not sure if its tech correct, but seems to work for what I want) Put this at the top of your page where you want the osc content <?php $orig_dir=getcwd(); chdir('shop/'); include('includes/application_top.php'); ?> then just rip the code from what ever page you want & dump below (or you could use an include - problem with an include is you cant mess with image paths)
strikedamic Posted November 16, 2007 Author Posted November 16, 2007 Hm it didn't really work... What's the application_top.php file for? What else do I have to include? Error code: Warning: chdir() [function.chdir]: No such file or directory (errno 2) in /home/sinister/public_html/blog/wordpress/wp-content/themes/dark-city-10/sidebar.php on line 9 Warning: main(includes/application_top.php) [function.main]: failed to open stream: No such file or directory in /home/sinister/public_html/blog/wordpress/wp-content/themes/dark-city-10/sidebar.php on line 10 Warning: main(includes/application_top.php) [function.main]: failed to open stream: No such file or directory in /home/sinister/public_html/blog/wordpress/wp-content/themes/dark-city-10/sidebar.php on line 10 Warning: main() [function.include]: Failed opening 'includes/application_top.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php:/usr/share/pear') in /home/sinister/public_html/blog/wordpress/wp-content/themes/dark-city-10/sidebar.php on line 10 :( Please help me, I don't know how to code PHP, and I just want my Recent Product that's displayed in a box in OSC to be included in a box in a non-OSC page. Directories: (Target) sinister.ch/blog/wordpress/wp-content/themes/dark-city-10/sidebar.php (WITHOUT the OSC box, just the exact content of the box!) (Source) Recent Product Box in OSC: sinister.ch/shop/osc . . . (left column) THANK YOU!
knott Posted November 19, 2007 Posted November 19, 2007 http://www.oscommerce.com/community/contri...search,anywhere http://www.oscommerce.com/community/contri...search,anywhere both of these... or learn a bit of php application_top.php includes all the bits you need to display the page... connection to db etc. try this... chdir('../youroscshoppath/') just a guess as I'm no expert either
Recommended Posts
Archived
This topic is now archived and is closed to further replies.