You could try this ...
Edit the file:
/includes/modules/pages/login/header_php.php
and add the code in RED:
Change the setting for the:Code:$_SESSION['customer_zone_id'] = $check_country->fields['entry_zone_id']; // bof: check customer zone for valid zone to order some products $valid_zone_id = 37; // enter value of valid zone $valid_zone = true; $check_flag = false; $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . $valid_zone_id . "' and zone_country_id = '" . $check_country->fields['entry_country_id'] . "' order by zone_id"); while (!$check->EOF) { if ($check->fields['zone_id'] < 1) { $check_flag = true; break; } elseif ($check->fields['zone_id'] == $check_country->fields['entry_zone_id']) { $check_flag = true; break; } $check->MoveNext(); } if ($check_flag == false) { $valid_zone = $check_flag; } $_SESSION['ship_to_customer_valid_zone'] = $valid_zone; // eof: check customer zone for valid zone to order some products
$valid_zone_id =37;
to the zone id for you Zone Definition for the 37...
Edit the file:
/includes/functions/functions_general.php
and find the:
function zen_get_buy_now_button
then add the code in RED:
change the master_categories_id from 10, 12 to be the master_categories_id that you need on:Code:$button_check = $db->Execute("select product_is_call, products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'"); // check Product for valid zone define('TEXT_CALL_FOR_PRICE2', 'Call for Price shipping'); define('TEXT_LOGIN_TO_SHOP_BUTTON_REPLACE2', 'Login for validation'); // master_categories_id are delimited in $chk_products_us_only $chk_products_us_only = in_array(zen_get_products_category_id($product_id), explode(",", '10, 12')); echo '$products_id: ' . $product_id . ' $master: ' . zen_get_products_category_id($product_id) . ' $chk_products_us_only: ' . $chk_products_us_only . ' good: ' . $_SESSION['ship_to_customer_valid_zone'] . '<br>'; switch (true) {
$chk_products_us_only = in_array(zen_get_products_category_id($product_id), explode(",", '10, 12'));
Code:case (zen_get_products_allow_add_to_cart($product_id) == 'N'): return $additional_link; break; // check Product for valid zone case ((!$_SESSION['ship_to_customer_valid_zone'] && $chk_products_us_only)): if ($_SESSION['customer_id'] > 0) { $return_button = '<a href="' . zen_href_link(FILENAME_CONTACT_US) . '">' . TEXT_CALL_FOR_PRICE2 . '</a>'; } else { $return_button = '<a href="' . zen_href_link(FILENAME_LOGIN, '', 'SSL') . '">' . TEXT_LOGIN_TO_SHOP_BUTTON_REPLACE2 . '</a>'; } break; case ($button_check->fields['product_is_call'] == '1'): $return_button = '<a href="' . zen_href_link(FILENAME_CONTACT_US) . '">' . TEXT_CALL_FOR_PRICE . '</a>'; break;


Reply With Quote

