WP Jcart and Session Problem solution

Support for the jCart WordPress plugin.

WP Jcart and Session Problem solution

Postby daminux » 17 Jul 2010, 12:46

Hi buddys,

Works and Rocks ! Jcart Display Anywhere / problem with jcart and session declaration
To use Jcart anywhere Before or After other Session Declaration (in my use case many object with session declaration in my template)

First :
in the Jcart template display : jcart Class: Method display_cart (make a variable output and replace all echo), And add return at the end of the method.
replace all :
Code: Select all
echo 'html output code with custom';

by :
Code: Select all
$output = 'html output code with custom';
// dont forget return in bottom of method
return $output;

Second :
In the jcart-admin.php in the bottom of wp_jcart function, replace and add :
Code: Select all
$cart->display_cart($jcart);

by :
Code: Select all
$output = $cart->display_cart($jcart);
return $output;


third :
place in the top of your template page the wp_jcart function call like this :
Code: Select all
$MyCart = wp_jcart('MyCarTemplateDisplay');

and place this $MyCart anywhere :
Code: Select all
echo $MyCart;


Have Fun

Daminux
daminux
 
Posts: 12
Joined: 06 May 2010, 20:06

Return to WordPress Plugin Help

Who is online

Users browsing this forum: No registered users and 1 guest

cron