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
