Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Configuring the Zen Cart Admin / Basic Configuration / Remove the "Units: 0.01 " and the "Min: 0.01" from a Particular Product Page

Remove the "Units: 0.01 " and the "Min: 0.01" from a Particular Product Page

Started by limelites on 5 Feb 2013, 6:21 PM · Views: 2,338

Results 1 to 17 of 17
5 Feb 2013, 6:21 PM
#1
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Post #1 by limelites

If you go to our pay an instalment page, here:

http://www.silkblooms.co.uk/-p-1652.html

Can anyone see a way of removing the text that says "Units: 0.01" and "Min: 0.01" from this page only? We used to hide the text with white .jpgs and some strategic positioning coordinates with CSS but cross browser compatibility was causing too many issues. Is there a way to simply remove it fro this page?

I can't find the file that generates this. Ideally, we'd just have to give it a style tag so we can use display:none in the actual product page.

5 Feb 2013, 6:23 PM
#2
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Post #2 by limelites

Actually, it looks like /includes/functions/functions_prices.php Line #428:

$the_min_units .= ($the_min_units ? ' ' : '' ) . PRODUCTS_QUANTITY_UNIT_TEXT_LISTING . ' ' . $check_units; 

Can anyone help with the syntax that would add a style to this so we can control it by CSS?

5 Feb 2013, 6:48 PM
#3
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Post #3 by limelites

I tired giving it a style class in english.php but the display:none; CSS doesn't seem to control .instalmentUnits..... can anyone see a better way of doing this?

define('PRODUCTS_QUANTITY_UNIT_TEXT_LISTING', '<class="instalmentUnits">  Units: ');
5 Feb 2013, 6:58 PM
#4
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Post #4 by limelites

Getting somewhere with this:

  define('PRODUCTS_QUANTITY_UNIT_TEXT_LISTING', '<h11>  Units: </h11>');

h11{display:none;}

However this only removes the "Units :" but leaves the 0.01 text.

Anyone help?

5 Feb 2013, 7:05 PM
#5
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Post #5 by limelites

I added this to functions_prices.php

. '<span class="h11">'

but it removes the add to cart button too :(

5 Feb 2013, 7:12 PM
#6
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Post #6 by gjh42

The text is generated in a function: zen_get_products_quantity_min_units_display() in /includes/functions/functions_prices.php.

Find about line 438```php
return $the_min_units;

Just above that, add a line```php
    if ($the_min_units != '') $the_min_units = '<span class="minUnits">' . $the_min_units . '</span>';

This will add the span only if text is output. You can style .minUnits{} as desired in your stylesheet. If you only want to hide this text for the one product, make a per-product stylesheet named like p_1652.css and put the rule in that.

5 Feb 2013, 7:16 PM
#7
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Post #7 by limelites

I think I'm approaching this from the wrong angle! Is there a way to disable this when the product id=1652 ?

// Return a products quantity minimum and units display
  function zen_get_products_quantity_min_units_display($product_id, $include_break = true, $shopping_cart_msg = false) {
    $check_min = zen_get_products_quantity_order_min($product_id);
    $check_units = zen_get_products_quantity_order_units($product_id);

    $the_min_units='';

    if ($check_min != 1 or $check_units != 1) {
      if ($check_min != 1) {
        $the_min_units .= PRODUCTS_QUANTITY_MIN_TEXT_LISTING . ' ' . $check_min;
      }
      if ($check_units != 1) {
        $the_min_units .= ($the_min_units ? ' ' : '' ) . PRODUCTS_QUANTITY_UNIT_TEXT_LISTING . ' ' . $check_units;
      }

Maybe need to add an 'else' or something in there?

5 Feb 2013, 7:30 PM
#8
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Post #8 by limelites

gjh42:

The text is generated in a function: zen_get_products_quantity_min_units_display() in /includes/functions/functions_prices.php.

Find about line 438```php
return $the_min_units;

> Just above that, add a line```php
    if ($the_min_units != '') $the_min_units = '<span class="minUnits">' . $the_min_units . '</span>';

This will add the span only if text is output. You can style .minUnits{} as desired in your stylesheet. If you only want to hide this text for the one product, make a per-product stylesheet named like p_1652.css and put the rule in that.

Thank you Glen! That works really well but I only need to disable this in product ID 1652 so I'll just add the css to the product description. Thank you!

Another question though, the same annoying little blighters are on the bottom row of all the product listings, like this one for example:

http://www.silkblooms.co.uk/enable-accessories-favours-c-1_245_376.html

How would you style it out of the listing pages? I still need to keep it in the product listing pages (other than 1652).

5 Feb 2013, 8:44 PM
#10
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Post #10 by gjh42

Nice, and even more flexible than my code. I opted for the quick method:)

To style the min/units in product listing pages, try```
#productListing .instalmentsMinUnits {display: none;}

> If you only want to hide this text for the one product, make a per-product stylesheet named like p_1652.css and put the rule in that.
5 Feb 2013, 9:14 PM
#11
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Post #11 by limelites

gjh42:

Nice, and even more flexible than my code. I opted for the quick method:)

To style the min/units in product listing pages, try```
#productListing .instalmentsMinUnits {display: none;}



Tried this, but doesn't seem to work:
```php
#productListing .instalmentsMinUnits {display: none;}

You can still see them, here:

http://www.silkblooms.co.uk/enable-accessories-favours-c-1_245_376.html

5 Feb 2013, 10:58 PM
#13
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Post #13 by limelites

Hi Glen,

It's working alright, sorry, I think I was looking at a cache as it just started to work so thank you. Much better now.

11 Feb 2013, 3:00 PM
#14
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Post #14 by limelites

Following on from this, another little dilemma with this product ID 1652:

http://www.silkblooms.co.uk/-p-1652.html

You can see that I've added a .jpg to the page and tried to position it over the top of the text that says, "quantity:". The image if you're looking at the page in Firebug is controlled by #instalmetnsEnterAmount{}

Looking at this across browsers and it's really messy. I've had to control it with IE stylesheets and that's not too bad but in Firefox 4.0 it's totally different from the latest Firefox.

Really, what I need to do is replace the text that says "Quantity:". Is there a way of doing this, but only in product ID 1652?

14 Feb 2013, 10:29 AM
#15
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Post #15 by limelites

limelites:

Following on from this, another little dilemma with this product ID 1652:

http://www.silkblooms.co.uk/-p-1652.html

You can see that I've added a .jpg to the page and tried to position it over the top of the text that says, "quantity:". The image if you're looking at the page in Firebug is controlled by #instalmetnsEnterAmount{}

Looking at this across browsers and it's really messy. I've had to control it with IE stylesheets and that's not too bad but in Firefox 4.0 it's totally different from the latest Firefox.

Really, what I need to do is replace the text that says "Quantity:". Is there a way of doing this, but only in product ID 1652?

In my tpl_product_info_display.php I have the following code which generates an alternative add to cart button:

	if ($products_id == '1652') {
$the_button = PRODUCTS_ORDER_QTY_TEXT . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="6" size="8" />' . zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_INSTALLMENT_PAY_NOW, BUTTON_INSTALLMENT_PAY_NOW_ALT);
} else {
$the_button = PRODUCTS_ORDER_QTY_TEXT . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="6" size="2" />' . zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
}             }

Would it be possible to insert some code here that generates al alternative text so instead of saying "Quantity:" it could say, "Enter Payment Amount £"??

14 Feb 2013, 10:54 AM
#16
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Post #16 by limelites

OK, I added this to english.php:

define('PRODUCTS_ORDER_QTY_TEXT_1652','Enter payment amount in Pounds £');

Then I edited tpl_product_info.php:

	if ($products_id == '1652') {
$the_button = PRODUCTS_ORDER_QTY_TEXT_1652 . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="26" size="8" />' . zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_INSTALLMENT_PAY_NOW, BUTTON_INSTALLMENT_PAY_NOW_ALT);
} else {
$the_button = PRODUCTS_ORDER_QTY_TEXT . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="6" size="2" />' . zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
}

But the text is not wide enough. Look:
http://www.silkblooms.co.uk/modern-yellow-rose-groom-buttonhole-triple-yellow-buttonhole-p-1652.html?cPath=1_7

How would I make it look like this?:

14 Feb 2013, 11:02 AM
#17
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Post #17 by limelites

Simple actually, working perfectly now:

#cartAdd {
left: 482px;
text-align: right;
top: -20px;
** width: 300px;**
z-index: 990;
}