【问题标题】:Checkout form on Product page of OpencartOpencart 产品页面上的结帐表
【发布时间】:2017-11-08 13:45:03
【问题描述】:

我正在使用 opencart 2.3.0.2。我想直接在产品页面上显示结帐表格。 Journal2中安装的主题。我该怎么做?

【问题讨论】:

    标签: opencart checkout


    【解决方案1】:

    编辑文件:catalog/view/theme/yourtheme/template/product/product.tpl 并进行以下修改:

    查找代码:

    if (json['success']) {
                    $('.breadcrumb').after('<div class="alert alert-success">' + json['success'] + '<button type="button" class="close" data-dismiss="alert">&times;</button></div>');
    
                    $('#cart > button').html('<span id="cart-total"><i class="fa fa-shopping-cart"></i> ' + json['total'] + '</span>');
    
                    $('html, body').animate({ scrollTop: 0 }, 'slow');
    
                    $('#cart > ul').load('index.php?route=common/cart/info ul li');
                }
    

    替换为以下代码:

    if (json['success']) {
        window.location='index.php?route=checkout/checkout'; 
    }
    

    然后从管理员刷新修改缓存。
    转到​ admin >​ Extensions > Modifications 并单击蓝色的刷新按钮(右上角)以更新系统。​然后检查它。​(如果您的主题中有任何其他可用的缓存选项。此外,它会缓存刷新。)

    【讨论】:

    • 感谢您分享解决方案。但不幸的是它对我不起作用
    • 我已经检查了这个例子。从我们这边来看,它运行良好。也许,会缓存问题。请在更改后正确刷新/删除缓存。谢谢。
    猜你喜欢
    • 1970-01-01
    • 2015-04-17
    • 1970-01-01
    • 1970-01-01
    • 2021-09-30
    • 2015-05-02
    • 2019-12-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多