• Resolved vendidero

    (@vendidero)


    Hi there,

    we develop the plugin Germanized for WooCommerce, which is very popular among German users. Germanized adds a price per unit to the product data and shows that price in loops/archives as well as on the single product page. This price per unit uses the .price class as well. Your plugin overrides every .price instance it finds within the li-element on archive pages with the actual product price. That is not very nice ?? Either it should only override the first instance or check for span.price instead.

    Another option would be to provide a filter to exclude some elements from being replaced. You might pass that exclusion selector to your JS in assets/js/swatches.js updatePrice() function.

    Best,
    Dennis

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support Shravan Bhaskaravajjula

    (@bhshravankumar)

    Hello @vendidero, Greetings for the day!

    Thanks for your suggestions, I will forward your suggestions to our internal team, and they will review and plan accordingly.

    Hope this helps.

    Have a great day ahead.

    Plugin Support Shravan Bhaskaravajjula

    (@bhshravankumar)

    Hello @vendidero, we will need more clarity to provide some concrete solution for the same.

    • Can you please provide a screencast to show the issue and how to replicate the issue.
    • Updating content of span.price first may not be a great solution as some other plugin may prepend similar data before WooCommerce’s markup.
    • We are also thinking to provide a jQuery trigger which can be helpful for other integrations too.

    Looking forward to hearing from you.

    Thread Starter vendidero

    (@vendidero)

    Hi @bhshravankumar,

    to reproduce just install the Germanized plugin and configure a price per unit for a variable product. In the archive you’ll notice that the price per unit will be overridden with the product price.

    Updating content of?span.price?first may not be a great solution as some other plugin may prepend similar data before WooCommerce’s markup

    Could you elaborate on this a little more? What does that mean? The default Woo archive template uses a span-tag to output the price.

    We are also thinking to provide a jQuery trigger which can be helpful for other integrations too.

    A trigger will not help much. It would be nice to filter/adjust the actual price-finding selector which you are currently using in updatePrice(). Currently what you are doing to find the price is this:

    swatch.parents( 'li' ).find( '.price' );

    Either a:

    swatch.parents( 'li' ).find( '.price:first' );

    or:

    swatch.parents( 'li' ).find( 'span.price' );

    would be more explicit. You could ofcourse pass a PHP variable to the script too which allows plugin developers to adjust the actual price detection selector.

    Best,
    Dennis

    Plugin Support Shravan Bhaskaravajjula

    (@bhshravankumar)

    Hello @vendidero,

    Thanks for writing back.

    I have forwarded your suggestions to our team, they will review and plan accordingly.

    Best Regards,

    Plugin Support Shravan Bhaskaravajjula

    (@bhshravankumar)

    Hello @vendidero,

    I have forwarded your suggestions to our internal team, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.
    Thank you!

    Thread Starter vendidero

    (@vendidero)

    Hi @bhshravankumar,

    could you please keep me updated on the status?

    Plugin Support Shravan Bhaskaravajjula

    (@bhshravankumar)

    Hello @vendidero,

    Sure, I will contact our developers and update you on the status.

    Best Regards,

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Filter to adjust the price selector for archives’ is closed to new replies.