Free Shipping Icon

Locked

Started by autoace on 27 Mar 2010, 3:14 PM · Views: 2,147

Results 1 to 18 of 18
This thread is locked. New replies are disabled.
27 Mar 2010, 3:14 PM
#1
autoace avatar

autoace

Totally Zenned

Join Date:
Jun 2009
Posts:
618
Plugin Contributions:
0

Free Shipping Icon

Is there a way to modify this code, so that the Free Shipping Icon will appear IF the individual product meets the Free Shipping price point, currently set at $99 in the Free Shipping Options shipping module.

<!--bof free ship icon  -->
<?php if(zen_get_product_is_always_free_shipping($products_id_current) && $flag_show_product_info_free_shipping) { ?>
<div id="freeShippingIcon"><?php echo TEXT_PRODUCT_FREE_SHIPPING_ICON; ?></div>
<?php } ?>
<!--eof free ship icon  -->

Thank you,
autoace

27 Mar 2010, 5:15 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Free Shipping Icon

You can add to the IF that the Product Price is >= 99.00 ...

I would use the products_price_sorter field as that price is a pre-calculated "lowest" price for the Product ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

29 Mar 2010, 1:04 PM
#3
autoace avatar

autoace

Totally Zenned

Join Date:
Jun 2009
Posts:
618
Plugin Contributions:
0

Re: Free Shipping Icon

Ajeh:

You can add to the IF that the Product Price is >= 99.00 ...

I would use the products_price_sorter field as that price is a pre-calculated "lowest" price for the Product ...

Could you explain 'products_price_sorter' field and how to incorporate it into the IF statement. I have only entry-level knowledge of programming (working to improve that tho!).

Thank you,
autoace

29 Mar 2010, 2:25 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Free Shipping Icon

See if this helps you out by changing that code to read:

<!--bof free ship icon  -->
<?php if([B]zen_products_lookup((int)$_GET['products_id'], 'products_price_sorter') >= 99 && [/B]zen_get_product_is_always_free_shipping($products_id_current) && $flag_show_product_info_free_shipping) { ?>
<div id="freeShippingIcon"><?php echo TEXT_PRODUCT_FREE_SHIPPING_ICON; ?></div>
<?php } ?>
<!--eof free ship icon  -->

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

29 Mar 2010, 3:26 PM
#5
autoace avatar

autoace

Totally Zenned

Join Date:
Jun 2009
Posts:
618
Plugin Contributions:
0

Re: Free Shipping Icon

Ajeh:

See if this helps you out by changing that code to read:

<!--bof free ship icon --> <?php if([B]zen_products_lookup((int)$_GET['products_id'], 'products_price_sorter') >= 99 && [/B]zen_get_product_is_always_free_shipping($products_id_current) && $flag_show_product_info_free_shipping) { ?> <div id="freeShippingIcon"><?php echo TEXT_PRODUCT_FREE_SHIPPING_ICON; ?></div> <?php } ?> <!--eof free ship icon --> ```

I made the changes as you suggested and made sure my configurations were correct in my admin for this to show, however, the Free Shipping Icon is not displaying (Im testing on a product that I know satisfies the price point).

I thought there was a 'Free Shipping' Image that comes with the default ZC package or am I mistaken?

Thank you,
autoace

29 Mar 2010, 3:38 PM
#6
ajeh avatar

ajeh

Oba-san

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

Re: Free Shipping Icon

That's 'cause I goobered ... :blink:

I forgot you are not using the Always Free Shipping, just the price for this ...

Change the && to || in this line:

<?php if(zen_products_lookup((int)$_GET['products_id'], 'products_price_sorter') >= 99 [B]||[/B] zen_get_product_is_always_free_shipping($products_id_current) && $flag_show_product_info_free_shipping) { ?>

See if that doesn't work better off the price ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

29 Mar 2010, 4:03 PM
#7
autoace avatar

autoace

Totally Zenned

Join Date:
Jun 2009
Posts:
618
Plugin Contributions:
0

Re: Free Shipping Icon

Ajeh:

That's 'cause I goobered ... :blink:

I forgot you are not using the Always Free Shipping, just the price for this ...

Change the && to || in this line:

<?php if(zen_products_lookup((int)$_GET['products_id'], 'products_price_sorter') >= 99 [B]||[/B] zen_get_product_is_always_free_shipping($products_id_current) && $flag_show_product_info_free_shipping) { ?>
> 
> See if that doesn't work better off the price ... :smile:

Thank you - it works!  I even tested to make sure it works in both conditions and lowered the price of the item below the price point and the Free Shipping Icon DID NOT display!

One last question, is it possible to have this work on the product listing pages and if so can you guide me in the right direction.

Thanks very much for your help.

Thank you,
autoace

29 Mar 2010, 4:19 PM
#8
ajeh avatar

ajeh

Oba-san

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

Re: Free Shipping Icon

You can do something similar any where that you find the free shipping code and adapt the new code ...

The products_id will be called in a variety of ways based on where you are in the code ... if you look through code in the general area, you should be able to find how it is referenced ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

29 Mar 2010, 4:22 PM
#9
ajeh avatar

ajeh

Oba-san

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

Re: Free Shipping Icon

For example, in the product_listing.php module, you will see the code:

        $lc_text .= '<br />' . (zen_get_show_product_switch($listing->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? (zen_get_product_is_always_free_shipping($listing->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON . '<br />' : '') : '');

In this case, the products_id is referenced with:
$listing->fields['products_id']

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

29 Mar 2010, 6:44 PM
#10
autoace avatar

autoace

Totally Zenned

Join Date:
Jun 2009
Posts:
618
Plugin Contributions:
0

Re: Free Shipping Icon

Ajeh,

On the product info page, I want to have the Free Shipping Icon display right above the Qty Box and Add to Cart button. Any suggestions on how to go about this?

It currently display right below the main product image, I've tried a few things but I keep on breaking the page, so I know I'm not doing it right :(

Thank you,
autoace

29 Mar 2010, 7:42 PM
#11
ajeh avatar

ajeh

Oba-san

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

Re: Free Shipping Icon

The code is delimited with:

<!--bof free ship icon -->

code here

<!--eof free ship icon -->

You can move that code where you want it to display ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

30 Mar 2010, 2:42 PM
#12
autoace avatar

autoace

Totally Zenned

Join Date:
Jun 2009
Posts:
618
Plugin Contributions:
0

Re: Free Shipping Icon

Ajeh:

The code is delimited with:

<!--bof free ship icon -->

code here

<!--eof free ship icon -->

You can move that code where you want it to display ...

Yes, thank you, I got that much - LOL!

I am trying to put that code here, right above this line, where the Qty box and Add to Cart button are:

$the_button = PRODUCTS_ORDER_QTY_TEXT . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '<br />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);

but I keep on breaking the page!

Do you have any other suggestions on how to go about it. I would love to put the Free Shipping Icon right above the Qty box and Add to Cart button.

Thank you,
autoace

30 Mar 2010, 3:37 PM
#13
ajeh avatar

ajeh

Oba-san

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

Re: Free Shipping Icon

You could use something like:

    <?php
      echo $display_qty;
      echo $display_button;
            ?>

<!--bof free ship icon  -->
<?php if(zen_products_lookup((int)$_GET['products_id'], 'products_price_sorter') >= 99 || zen_get_product_is_always_free_shipping($products_id_current) && $flag_show_product_info_free_shipping) { ?>
<div id="freeShippingIcon"><?php echo TEXT_PRODUCT_FREE_SHIPPING_ICON; ?></div>
<?php } ?>
<!--eof free ship icon  -->

          </div>
  <?php } // display qty and button ?>

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

30 Mar 2010, 4:28 PM
#14
autoace avatar

autoace

Totally Zenned

Join Date:
Jun 2009
Posts:
618
Plugin Contributions:
0

Re: Free Shipping Icon

Ajeh:

You could use something like:

<?php
  echo $display_qty;
  echo $display_button;
        ?>
<!--bof free ship icon --> <?php if(zen_products_lookup((int)$_GET['products_id'], 'products_price_sorter') >= 99 || zen_get_product_is_always_free_shipping($products_id_current) && $flag_show_product_info_free_shipping) { ?> <div id="freeShippingIcon"><?php echo TEXT_PRODUCT_FREE_SHIPPING_ICON; ?></div> <?php } ?> <!--eof free ship icon -->
      </div>
<?php } // display qty and button ?>

I did as you suggested and it still breaks the page (after the bread crumbs) :(

Any other ideas?

Thank you,
autoace

30 Mar 2010, 4:35 PM
#15
ajeh avatar

ajeh

Oba-san

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

Re: Free Shipping Icon

I am not sure why the page is breaking but you might get the Debug Tool from the Free Software Add Ons and see if it shows any errors ...

I have not been able to repeat the error ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

30 Mar 2010, 4:51 PM
#16
autoace avatar

autoace

Totally Zenned

Join Date:
Jun 2009
Posts:
618
Plugin Contributions:
0

Re: Free Shipping Icon

Ajeh:

I am not sure why the page is breaking but you might get the Debug Tool from the Free Software Add Ons and see if it shows any errors ...

I have not been able to repeat the error ...

Yes, that's what I've been doing.

Well, at least I know it works, because its working for you :smile: I will have to keep at it. Thanks for your help.

Thank you,
autoace

30 Mar 2010, 6:33 PM
#17
autoace avatar

autoace

Totally Zenned

Join Date:
Jun 2009
Posts:
618
Plugin Contributions:
0

Re: Free Shipping Icon

Ajeh:

I am not sure why the page is breaking but you might get the Debug Tool from the Free Software Add Ons and see if it shows any errors ...

I have not been able to repeat the error ...

Hi Ajeh

Good news, I got it working :smile:

Used the debug tool and the error was caused by some other code that I had just installed for an addon (it was a stinkin' space).

It just needs some css help and then good to go. Thanks for your help!

Thank you,
autoace

30 Mar 2010, 6:48 PM
#18
ajeh avatar

ajeh

Oba-san

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

Re: Free Shipping Icon

You are most welcome ... glad that this is working for you ... thanks for the update that the problem was other custom code that you were working on ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!