Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Showing Shipping Estimator Only When Login

Showing Shipping Estimator Only When Login

Locked

Views: 873

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
13 Oct 2009, 12:37 PM
#1
yosemirza avatar

yosemirza

New Zenner

Join Date:
Aug 2009
Posts:
25
Plugin Contributions:
0

Showing Shipping Estimator Only When Login

Hello, May I ask some help. I want to set the Shipping Estimator only available when customer logged in to their account. How do I add the code? Thanks

13 Oct 2009, 11:30 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Showing Shipping Estimator Only When Login

Using your templates and overrides, edit the tpl_shopping_cart_default.php and change this line, arround 167:

    if (SHOW_SHIPPING_ESTIMATOR_BUTTON == '1') {

to read:

    if ($_SESSION['customer_id'] > 0 && SHOW_SHIPPING_ESTIMATOR_BUTTON == '1') {
14 Oct 2009, 3:57 PM
#3
yosemirza avatar

yosemirza

New Zenner

Join Date:
Aug 2009
Posts:
25
Plugin Contributions:
0

Re: Showing Shipping Estimator Only When Login

Thank you for help. I was trying to put the different code yesterday and it worked.

This is the code:

<?php
    if (SHOW_SHIPPING_ESTIMATOR_BUTTON == '1') {
?>
<?php if ($_SESSION['customer_id']) { ?>
<div class="buttonRow back"><?php echo '<a href="javascript:popupWindow(\'' . zen_href_link(FILENAME_POPUP_SHIPPING_ESTIMATOR) . '\')">' .
 zen_image_button(BUTTON_IMAGE_SHIPPING_ESTIMATOR, BUTTON_SHIPPING_ESTIMATOR_ALT) . '</a>'; ?></div>
<?php }?>
<?php
    }
?>
14 Oct 2009, 4:05 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Showing Shipping Estimator Only When Login

More or less the same idea, just instead of having 2 IF statements, mine uses 1 ...

Thanks for the update that you have this working now ... :smile: