- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我的 OpenCart 环境中有另一个页面,比方说关于我们的页面,它在下面有这些表格,假设用户在他们的购物车中有元素,这些表格应该有效但它们不:
在此输入您的优惠券代码:
<form action="index.php?route=checkout/cart" method="post" enctype="multipart/form-data" id="basket">
<input type="text" value="" id="coupon" name="coupon"/>
<input type="hidden" value="coupon" name="next"/>
<input type="submit" class="button" value="Apply Coupon"/>
</form>
在此输入您的礼券代码:
<form action="index.php?route=checkout/cart" method="post" enctype="multipart/form-data" id="basket">
<input type="text" value="" name="voucher"/>
<input type="hidden" value="voucher" name="next"/>
<input type="submit" class="button" value="Apply Voucher"/>
</form>
这是用于优惠券代码系统但它不起作用(此代码默认未编辑):
/catalog/controller/checkout/cart.php
// VOUCHER
// IF THE USER HAS ENTERED A VOUCHER
if (isset($this->request->post['voucher']) && $this->request->post['voucher']) {
foreach ($this->request->post['voucher'] as $key) {
if (isset($this->session->data['vouchers'][$key])) {
unset($this->session->data['vouchers'][$key]);
}
}
}
最佳答案
这三个系统 block 是OpenCart中的模块。它们循环在一起,您可以编辑文件,例如制作一些空白或使用 if/else
语句仅显示某些模块。
您不能在 cart.tpl
中调用表单本身,它必须是:
<div class="right">
<!-- eVoucher System -->
<?php foreach ($modules as $module) { ?>
<?=$module?>
<?php } ?>
<!-- eVoucher System -->
</div>
这将循环并显示模块 tpl 文件、运输、优惠券和凭证。他们的位置很奇怪
/catalog/view/theme/default/total/coupon.tpl
/catalog/view/theme/default/total/shipping.tpl
/catalog/view/theme/default/total/voucher.tpl
我们不会全部使用它们,因此我们已将优惠券和运费留空。优惠券表格如下:
<div>
<div class="cart-heading"><?php echo $heading_title; ?></div>
<div class="cart-content" id="coupon"><?php echo $entry_coupon; ?>
<input type="text" name="coupon" value="<?php echo $coupon; ?>" />
<a id="button-coupon" class="button"><span><?php echo $button_coupon; ?></span></a></div>
</div>
<script type="text/javascript">
<!--
//
// jQuery dependent based on .post so make sure
// your footer or header jQuery call is before this
//
$('#button-coupon').bind('click', function() {
$.ajax({
type: 'POST',
url: 'index.php?route=total/coupon/calculate',
data: $('#coupon :input'),
dataType: 'json',
beforeSend: function() {
$('.success, .warning').remove();
$('#button-coupon').attr('disabled', true);
$('#button-coupon').after('<span class="wait"> <img src="catalog/view/theme/default/image/loading.gif" alt="" /></span>');
},
complete: function() {
$('#button-coupon').attr('disabled', false);
$('.wait').remove();
},
success: function(json) {
if (json['error']) {
$('#basket').before('<div class="warning">' + json['error'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
}
if (json['redirect']) {
location = json['redirect'];
}
}
});
});
//-->
</script>
这就是这些文件的方式和位置,total
还有一个 Controller 和 coupon
,所有其他模块都是 Controller 和标准 MVC 驱动的。
因此,如果您希望在外部页面上使用,提取 tpl 文件以及 $modules
和 $module
循环,代码应该是:
(确保在 SEO URI 的情况下“斜线”index.php)
当然,例如,在您的“关于我们”页面上:
<strong>Please enter your coupon:</strong>
<form action="/index.php?route=total/coupon/calculate" method="post" enctype="multipart/form-data" id="basket">
<input type="text" value="" id="coupon" name="coupon"/>
<input type="hidden" value="coupon" name="next"/>
<input type="submit" class="button" value="Apply Coupon"/>
</form>
关于php - 如何获得外部页面优惠券/代金券表格以在 OpenCart 中使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12280666/
融e购拍一拍抽微信1-99元立减金/优惠券 微信搜索并关注“融e购”公众号 回复“拍一拍” 进入然后自己创建个群拉好友或者小号 在群里互拍对方 或者从下面链接进入小编的群大家都可以在里面互拍 每
三只松鼠收集福卡 抢千分礼包+优惠券 扫码进入微信活动文章页面 在活动页面中 下拉进入小程序 完成任务可以获得抽卡机会 收集福卡 可以得新年大礼包 有千分礼包 和 优惠券 大家速度收集 ~
我试图从优惠券折扣中排除一些具有特定产品属性的产品变体。 在我的例子中,我的目标是产品属性“finish”设置为“Classic Frame”或“Box Frame”术语的产品变体。 我尝试使用 "E
我正在使用 Paypal API 对实体商品和数字商品进行支付。 一切都按预期工作,但在我调用 set_express_checkout(使用 AngelEye PHP 类)并将用户重定向到 Payp
我可以在后端创建优惠券,但在结帐过程中,没有输入优惠券的选项。我能找到的唯一其他信息是如何通过注释掉该行来禁用优惠券 block type="checkout/cart_coupon"name="ch
我遇到了一些麻烦。我想要做的是,每次有人订阅我们的时事通讯时,都会在 Magento 中自动生成一个随机优惠券代码。优惠券是任何东西的 10 美元折扣,并且会有 exp。订阅后两周的日期。 所以,我正
我使用 Stripe 的默认表单进行付款处理。如何添加优惠券字段?我已经创建了优惠券,但我不确定如何处理优惠券代码。 " data-amount=1795 da
我正在与一个想要创建 100% 关闭订阅优惠券代码的客户合作。如果用户拥有这些优惠券代码之一,他们不希望用户必须输入信用卡。这在 Stripe 中可能吗? 我正在使用 Laravel Spark,当用
有人知道与Stripe一次性交易是否可以接受优惠券吗? 我知道您可以添加带有定期订阅的优惠券,但我只希望能够提供一次性付款折扣。 最佳答案 我认为这里的想法是,您可以完全控制单个费用(或一次性付款,无
是否有已知的方法可以通过 API 在 Magento 社区版中创建新的优惠券代码(购物车价格规则)? 我希望能够使用另一个网络应用程序自动生成优惠券代码,并通过一些后端通信在 Magento 中同时创
我一直找不到准确的答案。 我们已经知道,PayPal 的 REST API 没有应用折扣代码的选项。但是,我们可以将另一个项目添加到 item_list 中,其中包含一个 I.e. 的描述。促销/折扣
借助 QuantLib C++ 库,我尝试评估在其生命周期内具有不同息票的债券(例如,前三年为 6%,其余三年为 4%)。 我注意到 FixedRateBond 的构造函数类接受优惠券 vector
如标题中所述,我正在尝试通过电子邮件限制访问 WooCommerce 优惠券列表,以便在我的应用程序中使用它。 但是我确实成功访问了优惠券列表,但我无法通过电子邮件而非代码获取它。 现在我尝试使用 P
使用您自己的本地数据库镜像 Stripe 是一件好事吗? 使用 API 调用(创建新计划、优惠券、订阅等)和 webhook(生成新发票或费用、付款失败)进行镜像,因此您可以存储所有数据(字面意思是具
我是一名优秀的程序员,十分优秀!