Does anyone have time for call on discord to help me solve my problem;
Everything was normal till i code a add to cart in javascript,and it doesn't change total price etc.
Related
For my studies I'm working on a e-commerce website and I need to upgrade my work by getting the price of my articles only on the cart page (I can't put it in the localstorage because price can change and it will not affect the cart items), I'm totally lost..
Here is my project https://github.com/Altaryxa/kanap.git
Thanks for your help
I am trying to create a discount code to apply to items only in a specific category. In the past I have gone to conditions and clicked the plus + button to add, but today when I click it, nothing comes up. At the bottom of the screen it says javascript:void(0), I have tried on different computers and browsers and it's always the same. I also tried updating java but it did not make a difference. Please help?!
I am using this https://cdnjs.cloudflare.com/ajax/libs/minicart/3.0.6/minicart.min.js script to render a cart for my e-commerce website. This works pretty fine as I can add and remove items from the cart and view the subtotal. However, when it comes to linking with paypal (the main reason I think it was designed), I am unable to submit the cart details, i.e. all items' names and prices along with the total to paypal for processing payment. Can someone have a look and help me understand how to do this. At least, retrieve the price and quantity of each item and the total. If I can access these at any point in my application, that would be a great start.
Please find here a snippet of my use of the script to add an item to cart.
This is my inclusion of the javascript.
This is how it looks like in view.
You have add the shopping cart variables to pass your cart details to PayPal
Please find the below link,
https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/#shopping-cart-variables
I just spot an bug on my eCommerce website that Im not sure how to fully fix it.
I will not provide any code as there isnt anything to be upload that would change the system i built im not asking a review of what is wrong with my code. Im not looking for a code answer, but more an advice of what I should do.
In the process of a customer buying a product from my eCommerce website he/she will be directed to paypal, once paypal is proceed, my database will save his information as well as deduct the quantity of items purchased from the database(the deduction is to stop future customer buying an out of stuck item).
A problem that happened few days back is, once customer press "pay now" button information is sent to paypal and no information is returned until payment is completed. Meaning if an item with 1 quantity is left on the database before a customer pressed "buy now" button, there will still be 1 item left until that transaction is completed leaving a gab of minutes where another customer could also go to the same item and press "buy now". This means two customer could ended up purchasing an item with only 1 in stock.
How could I go about to fix this? Should I add a temporary deduction of the stock if someone pressed "pay now" button? How does website normally deal with this?
Thanks
Cant wait for the down votes, but hope someone is nice enough to give me some light!
We are doing some custom changes to our WooCommerce.
We are calling successfully:
WC()->cart->add_to_cart($PRODUCT_ID)
The product appears in the cart when we click on the cart icon.
However, what I cannot figure out is how to trigger automatically on the front-end the small mini-cart widget that appears when you use the regular 'Add to Cart' button on regular product pages.
What other calls do I need to make to have the same front-end behavior that occurs when you add a regular item to the cart.
Basically, I want to just show the user that the item was successfully added to the cart. It should display the message that the item was added to the cart and update the cart total in the top right corner.
Any help greatly appreciated.
Thank you.
So you are adding product to cart through you custom code and want to update the mini cart at the sane time. So you must be adding the product to cart on some ajax event, and then displaying the message. What you have to do is use wc_get_template function of woocommerce and load the mini-cart.php template and return this template html to your ajax request and as soon as ajax is successful output this html into the mini cart container. It will update the quantities and subtotal as well.