soflyy / oxygen-bugs-and-features

Bug Reports & Feature Requests for Oxygen
https://oxygenbuilder.com/
315 stars 29 forks source link

Woocommerce variation price element #704

Open Rados51 opened 5 years ago

Rados51 commented 5 years ago

Describe the feature you'd like to see included in Oxygen. Ability to add and move variation price same as regular price. It would be great option to use it on same place as price range so We can design better UI.

What are the use cases for this feature? e-commerce with variable products

Examples of this feature or functionality. fYIEE From this thread: https://stackoverflow.com/questions/43617537/move-woocommerce-variation-price

Also now it works partially in Oxygen with javascript from stackoverflow: https://www.facebook.com/Rados.A51/videos/2602019889844304/

Rados51 commented 4 years ago

Could be done with bit of jQuery:

(function($) {

    $(document).ready(function() {

        var originePrice = $(".oxy-product-price .price").html();

        $('.variations_form').on('woocommerce_variation_has_changed', function() {

            if ($(".variations_form select").val() == '') {

                $(".oxy-product-price .price").html(originePrice);

            } else if ($(".woocommerce-variation-price .woocommerce-Price-amount").length) {

                if ($(".woocommerce-variation-price span.price ins").length) {

                    var variationPrice = $(".woocommerce-variation-price span.price").html();

                    $(".oxy-product-price .price").html(variationPrice);

                } else {

                    var variationPrice = $(".woocommerce-variation-price .woocommerce-Price-amount").html();

                    $(".oxy-product-price .price").html(variationPrice);

                }

            }

        });

    });

})(jQuery);
KittenCodes commented 3 years ago

@Rados51 The Product Price element should work for single and variable products, as long as it's used within the Product Builder element.

jamescrabb commented 3 years ago

@Rados51 The Product Price element should work for single and variable products, as long as it's used within the Product Builder element.

I think Rados wants to separate the price from the variation selection so you can design better UI for variable products.

Currently the variable product select option is part of the product price element these would be great if they were separate.

KittenCodes commented 3 years ago

@jamescrabb Thank you for clarifying.

jamescrabb commented 3 years ago

@jamescrabb Thank you for clarifying.

No problem