Here are the first two pieces. Note: I changed my product buttons from the default images to css styled inputs. You can do yours anyway. I just wanted to save a little bandwidth.
Replace the "add to cart" button code in product_partial with the following.
<!-- Add To Cart -->
<?
// Look for the value of of the restricted item column
($restricted = $product->x_restricted_shipping)
?>
<?
// Checks to see if item is not a restriced item
if ($restricted == false):
?>
<input type="button" class="button_blue float_right"
onclick="return $(this).getForm().sendRequest('shop:on_addToCart', {
extraFields: {flash_partial: 'add_to_cart_partial'},
update: {'mini_cart': 'shop:mini_cart', 'product_page': 'product_partial' }})" value="Add to Cart"/>
<?
else:
// Show Restriced Button
?>
<input type="button" class="button_blue float_right"
onclick="return $(this).getForm().sendRequest('shop:on_addToCart', {
confirm: 'This item can only be shipped within the Continental United States, do you still want to add this item to your cart?',
extraFields: {flash_partial: 'add_to_cart_partial'},
update: {'mini_cart': 'shop:mini_cart', 'product_page': 'product_partial' }})" value="Add to Cart"/>
<? endif ?>
<!-- End Add To Cart --> If the item is restricted, when a customer adds it to their cart, a pop up window will open alerting the customer that the item being added is restricted, and ask them if they still want to add it to their cart. In my case, I alerted the customer that this item can only be shipped within the Continental United States.
The attached Zip File is a Restricted Shipping Module that creates a new column in the product database for the restricted option. It also creates Restricted Shipping check box in the product tab under shipping.
Attached File(s)
-
restrictedshipping.zip (1.35K)
Number of downloads: 1

Help













