sparkyhd Posted May 25, 2011 Share Posted May 25, 2011 The Prestashop is only part of my site, running in /shop and the rest of the site will be built with MODX.In the MODX pages I want to display a cart summary, something like "You have 1 item in your cart".I've been looking at the Webservice which I can access as below but how do I know which cart id is the one for the current user?Also is this approach the best way to show the cart on external pages or is there a better approach? Link to comment Share on other sites More sharing options...
sparkyhd Posted May 26, 2011 Author Share Posted May 26, 2011 To ask the question another way, how has this site got the cart to display in WordPress?Archiduchesse cart display Link to comment Share on other sites More sharing options...
sparkyhd Posted June 9, 2011 Author Share Posted June 9, 2011 I gave up on the web service. I got it working but is was really slow (on my WAMP server).Instead I got the data by placing the following code in a file in the root of the shop, which seems to work and quickly <?php include('config/config.inc.php'); include('init.php'); global $cookie; $blogcart = $cart->getSummaryDetails(); echo ' Products in cart = ' . count($blogcart['products']) . ''; $cartQty=0; foreach( $blogcart['products'] as $key => $value){ $cartQty += $value['cart_quantity']; } echo ' Number of items in cart = ' . $cartQty . ''; ?> Link to comment Share on other sites More sharing options...
ubik Posted February 19, 2012 Share Posted February 19, 2012 Hi, thanks for topic, i search to get the amount of cart instead of having quantity of article or number of item have you got idea ? Link to comment Share on other sites More sharing options...
cfmichel Posted February 23, 2012 Share Posted February 23, 2012 I hope you guys can help! My prestashop is located in a sub-directory of my website. Meaning I have a normal website (Home, About, Contact, etc) and there is a link to my prestashop. Is there ANY way at all that I could pull the cart information from Prestashop and place it in the usual php files that compose my run of the mill website? I would highly appreciate any insight! Link to comment Share on other sites More sharing options...
znorelo Posted November 12, 2012 Share Posted November 12, 2012 (edited) Hi @sparkyhd I try to do the same thing like you. I've made a wp-panier.php file with your code inside : <?php include('config/config.inc.php'); include('init.php'); global $cookie; $blogcart = $cart->getSummaryDetails(); echo ' Products in cart = ' . count($blogcart['products']) . ' '; $cartQty=0; foreach( $blogcart['products'] as $key => $value){ $cartQty += $value['cart_quantity']; } echo ' Number of items in cart = ' . $cartQty . ' '; ?> When I visite the page http://www.mywebsite.com/wp-panier.php, all it's good. BUT in my wordpress website http://www.mywebsite.com/blog I have a fatal error : Fatal error: Call to a member function getSummaryDetails() on a non-object in MY_DOCUMENT_ROOT/wp-panier.php line 5 In my header.php file in my theme I write : <?php include('../wp-panier-dev.php'); ?> Do you now any issue ? Edited November 12, 2012 by znorelo (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now