Forums / Setting Up Categories, Products, Attributes / Removed Qty Box, now want it back for some

Removed Qty Box, now want it back for some

Locked

Views: 12,371

Results 41 to 60 of 71
This thread is locked. New replies are disabled.
14 May 2007, 6:37 AM
#41
lilleypadgifts avatar

lilleypadgifts

Totally Zenned

Join Date:
Jan 2007
Location:
Southern California
Posts:
550
Plugin Contributions:
0

Removed Qty Box, now want it back for some

Here is # 16

gjh42:

OK, Tim, don't worry! Bite-size chunks coming up ;)

I included the full explanation for those who want to apply the logic to other situations; for you both, you can use what I have posted essentially as is.

Working in /includes/templates/your_template/templates/tpl_product_info_display.php, find this section ```php

<!--bof Product Price block --> <h2 id="productPrices" class="productGeneral"> <?php // base price if ($show_onetime_charges_description == 'true') { $one_time = '<span >' . TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION . '</span><br />'; } else { $one_time = ''; } echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int)$_GET['products_id']); ?></h2> <!--eof Product Price block --> ``` and add > > <?php if (!ereg("(^23$|^23_)",$cPath)) { ?> > > and > > <?php } ?> > > to get ```php <!--bof Product Price block --> <?php if (!ereg("(^23$|^23_)",$cPath)) { ?><!--no price in gallery --> <h2 id="productPrices" class="productGeneral"> <?php // base price if ($show_onetime_charges_description == 'true') { $one_time = '<span >' . TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION . '</span><br />'; } else { $one_time = ''; } echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int)$_GET['products_id']); ?></h2> <?php } ?><!--/no price in gallery --> <!--eof Product Price block --> ``` > Change 23 to your gallery category id, and the price will not be shown on any product viewed in the gallery.
14 May 2007, 6:39 AM
#42
lilleypadgifts avatar

lilleypadgifts

Totally Zenned

Join Date:
Jan 2007
Location:
Southern California
Posts:
550
Plugin Contributions:
0

Re: Removed Qty Box, now want it back for some

If its showing, I'll do the others

14 May 2007, 7:18 AM
#43
meltdown avatar

meltdown

Totally Zenned

Join Date:
Jun 2006
Location:
My family and I live in Brighton, England
Posts:
947
Plugin Contributions:
0

Re: Removed Qty Box, now want it back for some

LilleyPadGifts:

I see all 3 of those just fine. Is it working for your guys now?

Could you please copy and paste each of the three in their entirety? Thanks!!

Tim

14 May 2007, 7:19 AM
#44
meltdown avatar

meltdown

Totally Zenned

Join Date:
Jun 2006
Location:
My family and I live in Brighton, England
Posts:
947
Plugin Contributions:
0

Re: Removed Qty Box, now want it back for some

Sorry, didn't see your other post - I can see your repost of #16 - thanks!

14 May 2007, 7:20 AM
#45
lilleypadgifts avatar

lilleypadgifts

Totally Zenned

Join Date:
Jan 2007
Location:
Southern California
Posts:
550
Plugin Contributions:
0

Re: Removed Qty Box, now want it back for some

Yeah, that's all of # 16 up there and I wanted to make sure you can see the code in it before I posted the rest...let me know as soon as you can cause I"m heading for bed in a minute

14 May 2007, 7:20 AM
#46
lilleypadgifts avatar

lilleypadgifts

Totally Zenned

Join Date:
Jan 2007
Location:
Southern California
Posts:
550
Plugin Contributions:
0

Re: Removed Qty Box, now want it back for some

Ok, # 20 and 26 on the way... any others?

14 May 2007, 7:21 AM
#47
lilleypadgifts avatar

lilleypadgifts

Totally Zenned

Join Date:
Jan 2007
Location:
Southern California
Posts:
550
Plugin Contributions:
0

Re: Removed Qty Box, now want it back for some

Here is # 20

gjh42:

The other categories besides Comics don't have subcats, so I will include the simplest form of the test.

(^1$|^1_|^2$|^3$|^22$)

<?php echo (((!ereg("(^1$|^1_|^2$|^3$|^22$)",$cPath)) and $flag_show_product_info_quantity == 1 and $products_quantity >0) ? '<li>' . $products_quantity . TEXT_PRODUCT_QUANTITY . '</li>' : '') . "\n"; ?>
> If you want to include another top cat which has subcats (say id 27), you would add it to the above list like this:
>  
> (^1$|^1_|^2$|^3$|^22$|^27_)
14 May 2007, 7:21 AM
#48
lilleypadgifts avatar

lilleypadgifts

Totally Zenned

Join Date:
Jan 2007
Location:
Southern California
Posts:
550
Plugin Contributions:
0

Re: Removed Qty Box, now want it back for some

Here is # 26

gjh42:

In this section ```php

<!--bof Product details list --> <?php if ( (($flag_show_product_info_model == 1 and $products_model != '') or ($flag_show_product_info_weight == 1 and $products_weight !=0) or ($flag_show_product_info_quantity == 1) or ($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name))) ) { ?> <ul id="productDetailsList" class="floatingBox back"> <?php echo (($flag_show_product_info_model == 1 and $products_model !='') ? '<li>' . TEXT_PRODUCT_MODEL . $products_model . '</li>' : '') . "\n"; ?> <?php echo (($flag_show_product_info_weight == 1 and $products_weight !=0) ? '<li>' . TEXT_PRODUCT_WEIGHT . $products_weight . TEXT_PRODUCT_WEIGHT_UNIT . '</li>' : '') . "\n"; ?> <?php echo (($flag_show_product_info_quantity == 1) ? '<li>' . $products_quantity . TEXT_PRODUCT_QUANTITY . '</li>' : '') . "\n"; ?> ``` > replace the last line shown with this ```php <?php echo (((!ereg("(^1$|^1_|^2$|^3$|^22$)",$cPath)) and $flag_show_product_info_quantity == 1) ? '<li>' . $products_quantity . TEXT_PRODUCT_QUANTITY . '</li>' : '') . "\n"; ?> ``` > Note: I just removed the test for qty > 0 from this code - it was an addition for my own site.
14 May 2007, 7:32 AM
#49
gjh42 avatar

gjh42

Black Belt

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

Re: Removed Qty Box, now want it back for some

Now I can see all of the original code blocks... no trace of a problem.
Would be good to know what happened, but I'll accept just having it back. I really didn't want to have to recreate those code chunks.

14 May 2007, 7:38 AM
#50
lilleypadgifts avatar

lilleypadgifts

Totally Zenned

Join Date:
Jan 2007
Location:
Southern California
Posts:
550
Plugin Contributions:
0

Re: Removed Qty Box, now want it back for some

gjh42:

Now I can see all of the original code blocks... no trace of a problem.
Would be good to know what happened, but I'll accept just having it back. I really didn't want to have to recreate those code chunks.

Glenn, you mean you can see it in the original posts or in the copies I just posted?
They were never blank for me... obviously or I wouldn't have been able to fix my site! LOL! :D

14 May 2007, 7:41 AM
#51
meltdown avatar

meltdown

Totally Zenned

Join Date:
Jun 2006
Location:
My family and I live in Brighton, England
Posts:
947
Plugin Contributions:
0

Re: Removed Qty Box, now want it back for some

gjh42:

Now I can see all of the original code blocks... no trace of a problem.
Would be good to know what happened, but I'll accept just having it back. I really didn't want to have to recreate those code chunks.

Yep, now I can see them, too. Boh... Anyway, thanks for reposting, Lalla.

Glenn, I made the suggested code changes. As stated the price does not show. However, that does not resolve my issue because what does still show is the "Sold" image, which in my case is a "Reserved" image. What I hoped to accomplish was the elimination the Reserved or Sold image and price to create a true gallery for viewing only.

I'm sorry, I should have been more clear. Do you know off-hand if what I'm interested in can be accomplished?

Again, thanks so much for taking the time to help out. No matter what, that bit of code you provided will be put to use.

Tim

14 May 2007, 7:42 AM
#52
lilleypadgifts avatar

lilleypadgifts

Totally Zenned

Join Date:
Jan 2007
Location:
Southern California
Posts:
550
Plugin Contributions:
0

Re: Removed Qty Box, now want it back for some

Well, I must jump in the shower real quick... I will check back in before I fall into bed.... never knew all this code could be so exhausting!! LOL!
If you need me to post any other quotes, let me know and I'll do it before I go to bed.

Otherwise....
Glenn, THANK YOU again for all of your help! I think I can actually now focus on "stocking my shelves"..... only about 40,000 more comics to go and several thousand more pins.... and then there's all the other stuff.... :wacko:
wow.. I don't think even the shower is going to relax me enough to sleep! LOL!

Have a great nite guys!

14 May 2007, 7:45 AM
#53
lilleypadgifts avatar

lilleypadgifts

Totally Zenned

Join Date:
Jan 2007
Location:
Southern California
Posts:
550
Plugin Contributions:
0

Re: Removed Qty Box, now want it back for some

But.... I do have extra mouths to feed now

14 May 2007, 7:52 AM
#54
gjh42 avatar

gjh42

Black Belt

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

Re: Removed Qty Box, now want it back for some

Awwwww.... :)

I saw both the original code blocks and your repostings.

Tim, I expected you would have some more elements to hide, but didn't know exactly which ones.
You can use the same method of wrapping that test code around the output block.

Let me know all the parts that need to go and I can tell you where to find them.

14 May 2007, 8:53 AM
#55
meltdown avatar

meltdown

Totally Zenned

Join Date:
Jun 2006
Location:
My family and I live in Brighton, England
Posts:
947
Plugin Contributions:
0

Re: Removed Qty Box, now want it back for some

LilleyPadGifts:

But.... I do have extra mouths to feed now

Too cute! Congratulations!

14 May 2007, 10:28 AM
#56
meltdown avatar

meltdown

Totally Zenned

Join Date:
Jun 2006
Location:
My family and I live in Brighton, England
Posts:
947
Plugin Contributions:
0

Re: Removed Qty Box, now want it back for some

gjh42:

Awwwww.... :)

I saw both the original code blocks and your repostings.

Tim, I expected you would have some more elements to hide, but didn't know exactly which ones.
You can use the same method of wrapping that test code around the output block.

Let me know all the parts that need to go and I can tell you where to find them.

Basically I think the page as-is is good as far as presentation of product. It seems that the only other item I'd like to remove is the "Add to cart" box, which I assume would then also be the "Sold" box (or "Reserved" in my case) depending on each items individual setting via the admin.

Using your code example, I did attempt to do this myself in tpl_product_info_display.php:

<!--bof Add to Cart Box -->
<?php if (!ereg("(^13$|^13_)",$cPath)) { ?><!--no image in gallery -->
if (CUSTOMERS_APPROVAL == 3 and TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE_SHOWROOM == '') {
  // do nothing
} else {
?>
            <?php
    $display_qty = (($flag_show_product_info_in_cart_qty == 1 and $_SESSION['cart']->in_cart($_GET['products_id'])) ? '<p>' . PRODUCTS_ORDER_QTY_TEXT_IN_CART . $_SESSION['cart']->get_quantity($_GET['products_id']) . '</p>' : '');
            if ($products_qty_box_status == 0 or $products_quantity_order_max== 1) {
              // hide the quantity box and default to 1
              $the_button = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
            } else {
              // show the quantity box
    $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);
            }
    $display_button = zen_get_buy_now_button($_GET['products_id'], $the_button);
  ?>
  <?php if ($display_qty != '' or $display_button != '') { ?>
    <div id="cartAdd">
    <?php
      echo $display_qty;
      echo $display_button;
            ?>
          </div>
  <?php } // display qty and button ?>
<?php } // CUSTOMERS_APPROVAL == 3 ?>
<?php } ?><!--/no image in gallery -->
<!--eof Add to Cart Box-->

Not surprisingly it returned an error. Oh well - Can't blame a guy for trying.

Is that even the right place to make the change?

14 May 2007, 3:52 PM
#57
gjh42 avatar

gjh42

Black Belt

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

Re: Removed Qty Box, now want it back for some

What was the error?
I suspect that, since this section contains a form input, it may not be possible to just skip it entirely.

A refinement that occurred to me last night would put the category-specific code in only one spot and use it to set a flag that could be applied anywhere desired. This eliminates the possibility of changing a category id in one spot and forgetting it in another spot.

<?php 
$notGallery = 1
if (ereg("(^13$|^13_)",$cPath)) { /*no image in gallery*/
  $notGallery = 0
} ?>
``` Put this snippet near the top of tpl_product_info_display, say near line 16:
```php
<div class="centerColumn" id="productGeneral">

<?php 
$notGallery = 1
if (ereg("(^13$|^13_)",$cPath)) { /*no image in gallery*/
  $notGallery = 0
} ?>

<!--bof Form start-->
<!--bof Product Price block -->
<?php if ($notGallery) { ?><!--display if not in gallery -->
<h2 id="productPrices" class="productGeneral">
<?php
// base price
  if ($show_onetime_charges_description == 'true') {
    $one_time = '<span >' . TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION . '</span><br />';
  } else {
    $one_time = '';
  }
  echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int)$_GET['products_id']);
?></h2>
<?php } ?><!--/display if not in gallery -->
<!--eof Product Price block -->

For the add to cart section, we need a different approach because we can't eliminate it. Give the div that contains the button a different id if in the gallery category, and style that id to "hidden" in the stylesheet.

Hmm... Hold that thought. I just noticed a coding error from your post that could be your whole problem. Or maybe not... You replaced the opening <?php with the if test code which then closes php like this ?>. It needs to stay open here.
Try this first:

<!--bof Add to Cart Box -->
<?php if ($notGallery) { /*display if not in gallery*/
if (CUSTOMERS_APPROVAL == 3 and TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE_SHOWROOM == '') {
  // do nothing
} else {
?>
            <?php
    $display_qty = (($flag_show_product_info_in_cart_qty == 1 and $_SESSION['cart']->in_cart($_GET['products_id'])) ? '<p>' . PRODUCTS_ORDER_QTY_TEXT_IN_CART . $_SESSION['cart']->get_quantity($_GET['products_id']) . '</p>' : '');
            if ($products_qty_box_status == 0 or $products_quantity_order_max== 1) {
              // hide the quantity box and default to 1
              $the_button = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
            } else {
              // show the quantity box
    $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);
            }
    $display_button = zen_get_buy_now_button($_GET['products_id'], $the_button);
  ?>
  <?php if ($display_qty != '' or $display_button != '') { ?>
    <div id="cartAdd">
    <?php
      echo $display_qty;
      echo $display_button;
            ?>
          </div>
  <?php } // display qty and button ?>
<?php } // CUSTOMERS_APPROVAL == 3 ?>
<?php } ?><!-- /display if not in gallery -->
<!--eof Add to Cart Box-->

If you still get an error (probably a different one), let me know and I'll explain the stylesheet hide method.

14 May 2007, 3:59 PM
#58
meltdown avatar

meltdown

Totally Zenned

Join Date:
Jun 2006
Location:
My family and I live in Brighton, England
Posts:
947
Plugin Contributions:
0

Re: Removed Qty Box, now want it back for some

The good news: No Error! :clap:

The bad news: It removed the "add to cart" storewide. :no:

14 May 2007, 4:02 PM
#59
gjh42 avatar

gjh42

Black Belt

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

Re: Removed Qty Box, now want it back for some

Did you get the latest bit of code at the top of my post? I was editing it probably while you were working.
If you didn't add that part properly, it would hide all adds.

14 May 2007, 4:09 PM
#60
meltdown avatar

meltdown

Totally Zenned

Join Date:
Jun 2006
Location:
My family and I live in Brighton, England
Posts:
947
Plugin Contributions:
0

Re: Removed Qty Box, now want it back for some

Concerning the refinement you mentioned in post #57: You have 3 snippets of code. For the second you recommended placement near line 16.

The third snippet is replacing the original <!--bof Product Price block --> to <!--eof Product Price block -->

As for the first bit: Does placement matter?