Okay
  Public Ticket #4536219
Regressione carrello dopo ultimo aggiornamento – reiniezione _salesking_set_price
Open

Comments

  •  1
    account-6690 started the conversation

    Hello,

    after updating to the latest version of SalesKing we are experiencing a regression in the cart behavior related to price handling.

    Context: we use an external WooCommerce-based discount system that correctly applies product discounts before the cart is displayed.

    Before the update, SalesKing behavior was:

    • it read the already discounted product price

    • it built the price editing UI starting from that value

    • it did not override the price unless the agent explicitly changed it

    After the update, the behavior changed:

    • _salesking_set_price is always injected and submitted during update_cart

    • the price is forcibly reapplied even when the agent has not modified anything

    • as a result, clicking “Update cart” resets externally applied discounts

    The issue occurs only during the cart update cycle (form submit).
    Product page, mini-cart, and the initial cart load all show the correct discounted price.

    We verified that the problem is related to how _salesking_set_price is handled during cart recalculation and seems consistent with changes introduced in the latest version (likely timing or priority changes in the cart lifecycle).

    We currently apply a local workaround to prevent the override when the agent has not interacted with the price, but we would like to ask:

    • whether this new behavior is intentional

    • or if it is possible to restore the previous logic (do not force _salesking_set_price unless the agent actually changes the price)

    We are happy to provide additional technical details or reproducible examples if needed.

    Thank you.

  •  2,630
    WebWizards replied

    Hi there,

    Glad to assist,

    I've checked our code that sets `salesking_set_price` going back to Version 1.7.70 (July 25th, 2025), but I haven't found any differences in how this is handled. Our internal function 'set_price_in_cart' is identical between that version and the current one.

    Therefore I'm not sure the issue is related to changes in SalesKing itself. It's possible that one of the other plugins in your setup has had changes in terms of pricing or cart functionality. This kind of setup can be quite fragile since multiple plugins are applying pricing code on the same WooCommerce hooks without being aware of each other.

     

    If you'd like, I can look into this in more detail and investigate further, including running some tests with older versions of SalesKing to see if it behaves differently. For that, I'd need a backend login to the site or a staging clone site. In that case it would also help if you could share a specific example of the exact steps / clicks to be able to reproduce the issue,

     

    Kind regards,
    Stefan