Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Shopping cart outside of OSC


Guest

Recommended Posts

Posted

Hi, I searched a bit but didn't see what I was looking for so hopefully someone here has done what I want.

 

I have merged parts of a clients OSC install into their WordPress install. Most of what I have done works fine.

 

All I did to get the ball rolling was to add:

 

<?php require_once "/home/******/www/contact-lenses/includes/application_top.php";?>

<?php require_once "/home/******/www/contact-lenses/includes/configure.php";?>

 

to the top of the wordpress header but I have hit a wall with the cart.

 

If you check out my development copy at http://contactlenz.afterdarkdevelopment.com/ you will see what I am trying to do with the shopping cart.

 

The header is fine in OSC (using <span style="float:left"><?php echo $cart->count_contents(); ?> Items</span><span style="float:right; color:#358BC2"><?php echo $currencies-> format($cart->show_total()); ?></span>) but outside of OSC it gives a "Fatal error: Call to a member function calculate_price()" and clears the cart.

 

I know this has been done before, I am just not familure with OSC to do it.

 

Site is not live so if someone has time, go play.

 

Thanks in advance for any direction.

Posted

I think your issue is with the currency box and not the code you posted, but I couldn't duplicate your problem. In includes\boxes\currencies.php

 

Change:

 

	$info_box_contents[] = array('form' => tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get'),

 

To:

 

	$info_box_contents[] = array('form' => tep_draw_form('currencies', tep_href_link($PHP_SELF, '', $request_type, false), 'get'),

Posted
I think your issue is with the currency box and not the code you posted, but I couldn't duplicate your problem. In includes\boxes\currencies.php

 

Change:

 

	$info_box_contents[] = array('form' => tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get'),

 

To:

 

	$info_box_contents[] = array('form' => tep_draw_form('currencies', tep_href_link($PHP_SELF, '', $request_type, false), 'get'),

 

Thanks for try but it didn't seem to make any difference.

 

 

Fatal error: Call to a member function calculate_price() on a non-object in /home/******/public_html/contact-lenses/includes/classes/shopping_cart.php on line 272

 

while trying to view any of the pages outside of OSC, and then it empties the cart.

 

As before, the pages within OSC work still.

 

I am just not setting up something or including something that is needed to make it work on the pages outside of OSC.

Posted

Ok so I played around with this a bit more today and am getting no where. Could it be session related?

Posted

The solution I gave you was from my Tip and Trick for putting pages in a subdirectory, you had the first part working with the applications_top.php but it broke the currency box hence the code I gave you. You might want to dig up the thread I started in the Tips and Tricks and have a look at it and see if there is anything there that might help.

 

You might want to also check these contributions

 

http://addons.oscommerce.com/info/6809

 

http://addons.oscommerce.com/info/3886

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...