Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore General Questions › eStore – add to cart does not work between different pages
- This topic has 8 replies, 3 voices, and was last updated 7 years, 1 month ago by todd.tran.
-
AuthorPosts
-
September 15, 2017 at 11:52 pm #14418todd.tranMember
Hi Admin,
I’ve just bought the eStore plugin and is trying to test out the features but unfortunately somehow it doesn’t work as what I expected. Basically, I’ve done the following follow your instructions:
1. I added some of my products briefly description using eStore > Add/Edit Product, then I added shortcode [wp_eStore_fancy1 id={my_product_id}] to Product page so that our customers can choose “Add to cart” button from this page as well.
2. I created separated pages for each of my products for a full description and assigned them to different Categories using WordPress’s menu feature under Appearance. Then I linked them with the eStore products by specifying the URL in “Product URL” field. On each of my product pages, I have added [wp_eStore_add_to_cart id={my_product_id}] so that customer also can choose “Add to cart” after reading the product’s full description.
3. I created a separated “Shopping Cart” page as a finally checkout page and added [wp_eStore_cart] to show the final cart status. I’ve also gone to eStore setting to specify the checkout page to point to my Shopping Cart page and check the “Automatic redirection to checkout page” checkbox.
After all of the above steps, I tried to test and realized everything’s working fine except the “Add to cart” button on both Products and Categories sites. It’s still can redirected to my Shopping Cart page but always showing an empty cart there no matter how many products I’ve added in.
Hence, could you please help to give me any suggestion or guideline on how to make it work? Also please let me know if there is anything unclear on my steps. I can always provide you more details like sending you the screenshots.
Thanks!
September 16, 2017 at 12:26 am #76432adminKeymasterYour site may have a PHP session issue. The following post has info on it:
https://support.tipsandtricks-hq.com/forums/topic/php-session-not-working-correctly
September 21, 2017 at 12:05 am #76433todd.tranMemberHello Admin,
We’re actually using our local server to try out the website first before put it on the service hosting. However, I’ve followed the instruction on your provided link but unfortunately it still doesn’t work and I couldn’t see any error generated by our site. Could you please help? I can send you the php.ini and the setting files via email if it would be easier for you to find out the problem.
Thanks!
September 21, 2017 at 11:55 pm #76434adminKeymasterWe can’t do any troubleshooting with a localhost setup. You have to put the plugin on a live server. You don’t have to make anything live just have the plugin installed then put an add to cart button on a test page. Putting the plugin on a normal site won’t make anything visible from the front-end of your site. So it is totally okay to put the plugin there then create a test product and test using it. If you share the link of that test page (where you have the add to cart button), we can take a look.
September 22, 2017 at 5:39 pm #76435todd.tranMemberThanks Admin. I finally found the issue. It’s working good now. Thanks!
September 22, 2017 at 11:32 pm #76436todd.tranMemberHi Admin,
Could you please advise what is the function should I call if I want to use your shotcode [wp_eStore_add_to_cart id=<product_id>] in my WordPress custom page (using php and html)?
Thanks!
September 23, 2017 at 12:14 am #76437wzpModeratorThe “best” way is the following (2 is the product ID in this example):
do_shortcode('wp_eStore_add_to_cart id=2');
September 27, 2017 at 7:42 pm #76438todd.tranMemberHi,
Thank you very much for the prompt response. However, I’ve tried both ways below but it doesn’t work:
<button type=”button” onclick=”<?= do_shortcode(‘wp_eStore_add_to_cart id=2’) ?>”>ADD TO CART</button>
<div><?php do_shortcode(‘wp_eStore_add_to_cart id=2’); ?></div>
Basically, it was just staying there and couldn’t add any item to the shopping cart. Could you please help to have a look? Thanks!
September 27, 2017 at 11:03 pm #76439todd.tranMemberHi, I’ve figured it out! Thanks!
-
AuthorPosts
- You must be logged in to reply to this topic.