簡體   English   中英

Joomla + Virtuemart中的沖突(添加到購物車中的類別)

[英]Conflict in Joomla + Virtuemart (add to cart in category)

這是網站類別-http: //goo.gl/7lAlxl我已將“ default_addtocart.php”放置到/templates/ot_smarthouse/html/com_virtuemart/category/default_addtocart.php,並在類別中添加了購買按鈕(將代碼添加到/模板/ot_smarthouse/html/com_virtuemart/category/default.php):

<?php
$this->product = $product;
echo $this->loadTemplate('addtocart');
?>

現在按鈕出現在類別- http://prntscr.com/5xn8wn但是當我點擊產品不添加到購物車,就重定向到購物車(無添加產品)在我的模板ot_smarthouse我發現這個腳本(/模板/ ot_smarthouse / js / otscript.js):

/* OT Document JAVASCRIPT */
jQuery.noConflict();
jQuery(document).ready(function($) {

    $('a.ot_scrollable').bind('click', function(e) {
        e.preventDefault();
        $('html,body').animate({scrollTop: $(this.hash).offset().top});                                                         
    });

    $("#ot-body").append('<div id="ot-product-hover" class="product row-fluid" style="display: none; z-index:9999;"></div>');
    $(".product .spacer").mouseover(function() {
        $("#ot-product-hover").children().remove();
        $("#ot-product-hover").append($(this).parent().html());
        $("#ot-product-hover").css('width', parseInt($(this).width() + 42) + 'px');
        $("#ot-product-hover").css('top', parseInt($(this).offset().top - 5) + 'px');
        $("#ot-product-hover").css('left', parseInt($(this).offset().left - 5) + 'px');
        $("#ot-product-hover").css('display', 'block');
    });
    $("#ot-product-hover").mouseover(function() {
        $("#ot-product-hover").css('display', 'block');
    });
    $("#ot-product-hover, .product .spacer").mouseout(function() {
        $("#ot-product-hover").css('display', 'none');
    });
});

window.addEvent('domready', function () {
    $$('h3.mod-title').each(function (item) {
        var parts  = item.get('text').clean().split(' ');
        parts[0] = "<span class='first-word'>" + parts[0] + "</span>";

        item.set('html', parts.join(' '));
    });
});

當我禁用它時,一切正常。 但是,當我將鼠標懸停在產品上時,此腳本會增加懸停放大,因此需要此功能。

我該如何解決這個問題?

只需添加以下行:

vmJsApi::jPrice();

給你

html / com_virtuemart / category / default.php

<script>
$.noConflict();
jQuery( document ).ready(function( $ ) {
// Code that uses jQuery's $ can follow here.
});
// Code that uses other library's $ can follow here.
</script>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM