Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Customizing the Look of Your Shop / Templates, Stylesheets, Page Layout / how to add div to free shipping image in productListing?

how to add div to free shipping image in productListing?

Started by soniccc on 15 Oct 2011, 9:17 AM · Views: 977

Results 1 to 7 of 7
15 Oct 2011, 9:17 AM
#1
soniccc avatar

soniccc

Zen Follower

Join Date:
May 2010
Location:
Cyberspace
Posts:
387
Plugin Contributions:
0

Post #1 by soniccc

I've tried probably for a couple of days to add a div to this piece of code in includes/modules/product_listing.php

$lc_text .= (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_PRODUCTLISTING . '' : '') : '');

It's near to impossible. I managed to put a div that wraps around the free shipping image but it encapsulates the entire product listing image as well. It seems adding a div is not possible the normal way with this piece of code. I need to be able to close the div statement before it encapsulates the product listing image.

Anyone whose run into trouble with this one ?

15 Oct 2011, 4:43 PM
#2
ajeh avatar

ajeh

Oba-san

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

Post #2 by ajeh

How are you adding the <div> to that?

Have you an URL that shows this issue?

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!

16 Oct 2011, 12:23 PM
#3
soniccc avatar

soniccc

Zen Follower

Join Date:
May 2010
Location:
Cyberspace
Posts:
387
Plugin Contributions:
0

Post #3 by soniccc

I think I've tried every possible combination that I can come up with, without hitting the right spot. I'm using Dr.Byte's Column Layout Grid for my site. Sometimes when I paste the div's they're distorting the entire page lay-out. And sometimes the free shipping image appears on every product without this setting being invoked from the admin ..

Site link: http://test.soundfactory.nu/index.php?main_page=index&cPath=270

16 Oct 2011, 4:14 PM
#4
ajeh avatar

ajeh

Oba-san

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

Post #4 by ajeh

Have you tried adding it to the define for the free shipping icon in the:
/includes/languages/english/extra_definitions/product_free_shipping.php

with something like:

switch (true) {
  case ($_GET['main_page'] == 'index'):
    define('TEXT_PRODUCT_FREE_SHIPPING_ICON', '<div class="freeshipping-products_listing">' . zen_image(DIR_WS_TEMPLATE_IMAGES . 'always-free-shipping.gif', 'Always Free Shipping') . '</div>'); // for an image or comment out to use another
    break;
  case ($_GET['main_page'] == 'specials'):
    define('TEXT_PRODUCT_FREE_SHIPPING_ICON', '<div class="freeshipping-specials">' . zen_image(DIR_WS_TEMPLATE_IMAGES . 'always-free-shipping.gif', 'Always Free Shipping') . '</div>'); // for an image or comment out to use another
    break;
  default:
    define('TEXT_PRODUCT_FREE_SHIPPING_ICON', '<div class="freeshipping-default">' . zen_image(DIR_WS_TEMPLATE_IMAGES . 'always-free-shipping.gif', 'Always Free Shipping') . '</div>'); // for an image or comment out to use another
  break;
}

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!

16 Oct 2011, 8:01 PM
#5
soniccc avatar

soniccc

Zen Follower

Join Date:
May 2010
Location:
Cyberspace
Posts:
387
Plugin Contributions:
0

Post #5 by soniccc

Man how did you do that??? It works GREAT! I would never have come up with this solution myself ..

16 Oct 2011, 8:02 PM
#6
ajeh avatar

ajeh

Oba-san

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

Post #6 by ajeh

Trickie eh? Amaze myself sometimes ... :lamo:

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!

17 Oct 2011, 4:24 AM
#7
soniccc avatar

soniccc

Zen Follower

Join Date:
May 2010
Location:
Cyberspace
Posts:
387
Plugin Contributions:
0

Post #7 by soniccc

Thanks :)