Created
August 2, 2021 13:43
-
-
Save Vyacheslavkor/aa2f5482d1d488943eac9c50154b0c36 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/design/themes/responsive/templates/addons/call_requests/hooks/products/add_to_cart.post.tpl b/design/themes/responsive/templates/addons/call_requests/hooks/products/add_to_cart.post.tpl | |
index d75729ccf6..91771bb8c4 100644 | |
--- a/design/themes/responsive/templates/addons/call_requests/hooks/products/add_to_cart.post.tpl | |
+++ b/design/themes/responsive/templates/addons/call_requests/hooks/products/add_to_cart.post.tpl | |
@@ -1,5 +1,5 @@ | |
{if !$hide_form | |
- && $addons.call_requests.buy_now_with_one_click == "Y" | |
+ && $addons.call_requests.buy_now_with_one_click == "YesNo::YES"|enum | |
&& ($auth.user_id | |
|| $settings.Checkout.allow_anonymous_shopping == "allow_shopping" | |
) && $show_buy_now|default:true | |
@@ -12,24 +12,35 @@ | |
{break} | |
{/if} | |
{/foreach} | |
- | |
- {if $show_product_options || ($is_not_required_option || $details_page)} | |
- {include file="common/popupbox.tpl" | |
- href="call_requests.request?product_id={$product.product_id}&obj_prefix={$obj_prefix}" | |
- link_text=__("call_requests.buy_now_with_one_click") | |
- text=__("call_requests.buy_now_with_one_click") | |
- id="buy_now_with_one_click_{$obj_prefix}{$product.product_id}" | |
- link_meta="ty-btn ty-btn__text ty-cr-product-button cm-dialog-destroy-on-close" | |
- content="" | |
- dialog_additional_attrs=["data-ca-product-id" => $product.product_id, "data-ca-dialog-purpose" => "call_request"] | |
- } | |
- {else} | |
- {include file="buttons/button.tpl" | |
- but_text=__("call_requests.buy_now_with_one_click") | |
- but_href="products.view?product_id=`$product.product_id`" | |
- but_role="text" | |
- but_id="buy_now_with_one_click_{$obj_prefix}{$product.product_id}" | |
- but_meta="btn ty-btn ty-btn__text ty-cr-product-button" | |
- } | |
+ {if ( | |
+ $settings.General.inventory_tracking == "YesNo::NO"|enum | |
+ || $settings.General.allow_negative_amount == "YesNo::YES"|enum | |
+ || ( | |
+ $product_amount > 0 | |
+ && $product_amount >= $product.min_qty | |
+ ) | |
+ || $product.tracking == "ProductTracking::DO_NOT_TRACK"|enum | |
+ || $product.is_edp == "YesNo::YES"|enum | |
+ || $product.out_of_stock_actions == "OutOfStockActions::BUY_IN_ADVANCE"|enum | |
+ )} | |
+ {if $show_product_options || ($is_not_required_option || $details_page)} | |
+ {include file="common/popupbox.tpl" | |
+ href="call_requests.request?product_id={$product.product_id}&obj_prefix={$obj_prefix}" | |
+ link_text=__("call_requests.buy_now_with_one_click") | |
+ text=__("call_requests.buy_now_with_one_click") | |
+ id="buy_now_with_one_click_{$obj_prefix}{$product.product_id}" | |
+ link_meta="ty-btn ty-btn__text ty-cr-product-button cm-dialog-destroy-on-close" | |
+ content="" | |
+ dialog_additional_attrs=["data-ca-product-id" => $product.product_id, "data-ca-dialog-purpose" => "call_request"] | |
+ } | |
+ {else} | |
+ {include file="buttons/button.tpl" | |
+ but_text=__("call_requests.buy_now_with_one_click") | |
+ but_href="products.view?product_id=`$product.product_id`" | |
+ but_role="text" | |
+ but_id="buy_now_with_one_click_{$obj_prefix}{$product.product_id}" | |
+ but_meta="btn ty-btn ty-btn__text ty-cr-product-button" | |
+ } | |
+ {/if} | |
{/if} | |
{/if} | |
\ No newline at end of file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment