bir site üzerinde çalışıyorum fakat burada takıldım. Ürün seçeneklerini gösteren bir dropdown variant selector'um var. Bu script olmadan selector çalışmıyor fakat bu scripti ekleyince'de selector kayboluyor. Konu hakkında yardımcı olabilecek bilgili birisi var mı acaba?
Bu scriptsiz hali gördüğünüz üzere 2.700 seçili ama yukarıdaki fiyatı değiştirmediği gibi sepete ekle dediğimde de ilk seçenek sepete ekleniyor.

Bu scriptli hali. Bunda seçenekler çalışıyor deneme yaptım fakat scripti ekleyerek yukarıdaki dropdown'ı getiremedim.

<script>
var selectCallback = function(variant, selector) {
var $addToCart = $('#button-cart'),
$addToCartBuy = $('#button-cart-buy'),
$addToCartSticky = $('#button-cart-sticky'),
$productPrice = $('#productPrice'),
$comparePrice = $('#comparePrice'),
$variantQuantity = $('#variantQuantity'),
$quantityElements = $('.quantity-selector, label + .js-qty'),
$addToCartText = $('#button-cart'),
$featuredImage = $('#productPhotoImg');
if (variant) {
// Regardless of stock, update the product price
Shopify.money_format = '{{shop.money_format }}';
//var customPrice = timber.formatMoney( Shopify.formatMoney(variant.price,Shopify.money_format) );
var a11yPrice = Shopify.formatMoney(variant.price, Shopify.money_format);
// var customPriceFormat = ' <span aria-hidden="true">' + customPrice + '</span>';
var customPriceFormat = ' <span class="visually-hidden">' + a11yPrice + '</span>';
$productPrice.html(customPriceFormat);
// Also update and show the product's compare price if necessary
{% if settings.product_show_compare_at_price %}
if ( variant.compare_at_price > variant.price ) {
var a11yComparePrice = Shopify.formatMoney(variant.compare_at_price, Shopify.money_format);
comparePriceFormat = ' <span class="visually-hidden">' + a11yComparePrice + '</span>';
$comparePrice.html(comparePriceFormat);
$comparePrice.show();
} else {
$comparePrice.hide();
}
{% endif %} }
};
jQuery(function($) {
var product = {{ product | json }};
new Shopify.OptionSelectors('productSelect', {
product: product,
onVariantSelected: selectCallback,
enableHistoryState: true
});
});
</script>