• Resolved Samuel

    (@martdsam)


    Add discount rules in the minicart. I used the woocommerce_mini_cart () function to get the minicart, but it does not contain the rebate information.
    Another problem is that I was building my own side cart and I came across this problem to get the price of the product with the discount rule applied. Is there a function I can use to get the price of the product with the discount rule on custom product listings?

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author flycart

    (@flycart)

    Have you tried turning on the Force refresh mini cart widget in our plugin settings ?

    Can you give it a try and let us know.

    Thanks
    Ramesh

    Thread Starter Samuel

    (@martdsam)

    Now it show the discount rules. But if I add a product by AJAX, the product in the minicart applies the 2x discount rule. The price will only stay correct if I refresh the page. I ran a test without the plugin enabled and this problem does not occur in product with the special price of woocommerce. Remembering that I have no other plugin enabled, just woocommerce and the discount rule plugin. The theme has no change in the basis of woocommerce. Thanks ??

    • This reply was modified 6 years, 4 months ago by Samuel.
    • This reply was modified 6 years, 4 months ago by Samuel.
    • This reply was modified 6 years, 4 months ago by Samuel.
    Thread Starter Samuel

    (@martdsam)

    To make it easier to test the problem. I installed a side cart plugin with AJAX and the same error happened.

    The discount is applied 2x on the product. But when you give f5 on the page the value is correct.

    The error only occurs when a product is already in the cart and I buy one more item of the same product. Or when I update the quantity of a product that is already in the cart.

    I have only one active discount rule. It is a rule that applies a 25% discount on all products on the site.

    This is the plugin:
    Ajax cart plugin

    Ajax cart is a very good functionality for website usability. I would be grateful if you could adjust this problem.
    Thanks for listening.

    • This reply was modified 6 years, 4 months ago by Samuel.
    Plugin Author flycart

    (@flycart)

    Hello Samuel

    Thank you for the detailed response.
    Is it possible to submit a support request providing admin login to site ? (If possible)
    https://www.flycart.org/support

    Thanks
    Ramesh

    Thread Starter Samuel

    (@martdsam)

    Unfortunately I can not. This problem is happening on my local machine.

    But it is very simple to simulate.
    I have 3 plugins enabled:
    Woocommerce,
    Discount rules,
    ajax cart.

    For theme you can use:
    https://underscores.me/

    Select the advanced options before downloading. And then enable the WooCommerce boilerplate option.

    Thread Starter Samuel

    (@martdsam)

    The products I’m using to test are the ones that come along with woocommerce in the CSV file.

    Thread Starter Samuel

    (@martdsam)

    Now I’ve taken one last test to make sure it was not my mistake.

    1 – I downloaded wordpress 4.9.7.
    2 – Downloaded the theme – https://underscores.me/ (Select the advanced options before downloading. And then enable the WooCommerce boilerplate option.)
    3 – I created a database in WAMP
    4 – I performed the installation
    4.1 – Activated the theme
    5 – I inserted the 3 plugins: woocommerce, price rules, Ajax cart.
    6 – I activated woocommerce, I ran the default configuration and imported the products from the CSV file that woocommerce offers.
    7 – I activated the price rules plugin. I created a 25% discount price rule for all products. In the settings you have activated the following options:
    – Show Price discount on product page
    – Show Sale tag on product page
    – Force refresh the cart widget while add and remove item to cart

    ?The rest left the pattern.

    8 – Activated the AJAX plugin cart. In the ajax cart settings I have enabled the following option: Add to cart without page refresh.

    9 – In wordpress settings, in permanent links. I activated it by the name of the post.

    10 – Go to the store page and buy the first product. The side car will open and everything will be correct.

    11 – Open the product page that was purchased. Now, inside the single product page, buy the same product again. We will see that the error happens. The discount was applied 2x.

    12 – Another way to simulate the error is Do not enable option: Force refresh the cart widget while add and remove item to cart. So the problem occurs in the product listing, without having to enter the page of a specific product. Just buy the same 2x product that the error happens.

    13 – The error only happens when a product is bought repeated. If you buy several products, however only 1 of each problem does not happen.

    I hope it has become clear. I am willing to help in whatever I can. Thanks for listening.

    Plugin Author flycart

    (@flycart)

    Hi

    Thank you for the detailed response. Really appreciate it.
    Let me try re-producing the issue and get back to you.

    Plugin Author flycart

    (@flycart)

    Hello Samuel

    Can you drop us a message via the support form at https://www.flycart.org/support
    ?
    Found the issue and fixed it.
    I can send you the updated package to your email.

    Thanks
    Ramesh

    Thread Starter Samuel

    (@martdsam)

    I sent the email.
    I’ll test and come back to say how it was.
    Very grateful for the attention and the solution. ??

    Thread Starter Samuel

    (@martdsam)

    Hello, Ramesh. I tested with your version sent by email. But the error still happens the same way.

    The error can happen in 2 ways:

    1 – With option: Force refresh the cart widget while add and remove item to cart – ON
    – It happens when you enter the product page (single product) purchase 1x of the product, the cart opens and yours is correct. Then you buy 1x again from the same product. Then the error happens, the discount is applied 2x.

    Image error

    2 – With option: Force refresh the cart widget while add and remove item to cart – OFF
    – It happens both in the product list and on the internal product page. For the error to happen do the same step as in item 1. However it happens on any page.

    Image error

    Remembering that the error applies to any product that is in the cart. That is, if I buy the product (A) 2 times, the products (B) / (C) or (D) that are in the cart will also have the discount applied 2 times, regardless of their quantities.

    Thanks for listening.

    Plugin Author flycart

    (@flycart)

    Hey there,
    We have fixed the issue with the Mini cart refresh. Will be releasing the fix shortly.

    Plugin Author flycart

    (@flycart)

    Hello Samuel

    We have fixed the issue with the mini cart / ajax cart refresh issues. and released a new version 1.6.9
    Please upgrade to the latest version that would solve the issue.

    Thanks
    ?Ramesh
    ?

    Thread Starter Samuel

    (@martdsam)

    Thank you very much for your effort.
    You are to be congratulated for the service.

    • This reply was modified 6 years, 4 months ago by Samuel.
Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Minicart price rules’ is closed to new replies.