Forums / Setting Up Categories, Products, Attributes / Show "in Stock" on 1 category

Show "in Stock" on 1 category

Started by zollster on 15 Apr 2010, 2:51 AM · Views: 1,611

Results 1 to 20 of 20
15 Apr 2010, 2:51 AM
#1
zollster avatar

zollster

New Zenner

Join Date:
Dec 2008
Posts:
22
Plugin Contributions:
0

Show "in Stock" on 1 category

i'm planning on selling some limited editions, so is there a way that if my product is linked to a "Limited Editions" category the "in stock" shows up? i dont want it on any other products
thanks

15 Apr 2010, 3:14 AM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Show "in Stock" on 1 category

You can always customize the code to only show the stock quantity for certain categories ...

Just surround that part of a code with an IF for testing the category that you are in and whether or not it should show ...

Be sure to use your templates and overrides directory for your changed files ...

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!

15 Apr 2010, 3:34 AM
#3
zollster avatar

zollster

New Zenner

Join Date:
Dec 2008
Posts:
22
Plugin Contributions:
0

Re: Show "in Stock" on 1 category

thanks.
bearing in mind php is REALLY not my strong suit...what would the code be? :)

15 Apr 2010, 3:52 AM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Show "in Stock" on 1 category

Can you give me an idea of what the categories_id is for the Products where stock should show? :unsure:

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!

15 Apr 2010, 4:33 AM
#5
zollster avatar

zollster

New Zenner

Join Date:
Dec 2008
Posts:
22
Plugin Contributions:
0

Re: Show "in Stock" on 1 category

Limited Editions :)

15 Apr 2010, 12:34 PM
#6
ajeh avatar

ajeh

Oba-san

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

Re: Show "in Stock" on 1 category

Let's pretend that the categories_id that you want to show is 10 ...

Change the code in your templates and overrides file to read:

  <?php echo (([B]$current_category_id == 10 && [/B]$flag_show_product_info_quantity == 1) ? '<li>' . $products_quantity . TEXT_PRODUCT_QUANTITY . '</li>'  : '') . "\n"; ?>

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!

15 Apr 2010, 12:35 PM
#7
zollster avatar

zollster

New Zenner

Join Date:
Dec 2008
Posts:
22
Plugin Contributions:
0

Re: Show "in Stock" on 1 category

Ajeh:

Let's pretend that the categories_id that you want to show is 10 ...

sorry..misunderstood :)

thanks muchly for the code

15 Apr 2010, 1:21 PM
#8
zollster avatar

zollster

New Zenner

Join Date:
Dec 2008
Posts:
22
Plugin Contributions:
0

Re: Show "in Stock" on 1 category

ok...i thought i'd got everything in the right places.... i've put it in tpl_document_general_info_display.php, tpl_document_product_info_display.php, tpl_product_free_shipping_info_display.php, tpl_product_info_display.php, tpl_product_music_info_display.php under ```

<!--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"> ```but when i click on the links to view the products. there's no product info. what am i missing?
15 Apr 2010, 1:39 PM
#9
ajeh avatar

ajeh

Oba-san

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

Re: Show "in Stock" on 1 category

If you mean you are getting blank pages, then you most likely have space(s) or blank line(s) after the closing php bracket ?> which will produce this problem ...

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!

15 Apr 2010, 1:51 PM
#10
zollster avatar

zollster

New Zenner

Join Date:
Dec 2008
Posts:
22
Plugin Contributions:
0

Re: Show "in Stock" on 1 category

no.. the page loads fine..but the bit that should show all the product price/img/details etc isnt there...its just the background picture

15 Apr 2010, 2:07 PM
#11
ajeh avatar

ajeh

Oba-san

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

Re: Show "in Stock" on 1 category

Have you a link to this URL that is not displaying correctly?

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!

15 Apr 2010, 2:25 PM
#13
ajeh avatar

ajeh

Oba-san

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

Re: Show "in Stock" on 1 category

From what I can see your page is not completing ...

Go to the Free Software Add Ons and search for:
Debug Tool

then load that to your site as instructed and see what errors are generated ...

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!

15 Apr 2010, 4:30 PM
#14
zollster avatar

zollster

New Zenner

Join Date:
Dec 2008
Posts:
22
Plugin Contributions:
0

Re: Show "in Stock" on 1 category

line 136 which is ```

<?php echo ((*$current_category_id == 21 && *$flag_show_product_info_quantity == 1) ? '<li>' . $products_quantity . TEXT_PRODUCT_QUANTITY . '</li>' : '') . "\n"; ?>

originally it was

<?php echo (($flag_show_product_info_quantity == 1) ? '<li>' . $products_quantity . TEXT_PRODUCT_QUANTITY . '</li>' : '') . "\n"; ?>
15 Apr 2010, 4:38 PM
#15
ajeh avatar

ajeh

Oba-san

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

Re: Show "in Stock" on 1 category

Fix your errors ... the * does not belong in there:

<?php echo (([B]*[/B]$current_category_id == 21 && [B]*[/B]$flag_show_product_info_quantity == 1) ? '<li>' . $products_quantity . TEXT_PRODUCT_QUANTITY . '</li>'  : '') . "\n"; ?>

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!

15 Apr 2010, 5:07 PM
#16
zollster avatar

zollster

New Zenner

Join Date:
Dec 2008
Posts:
22
Plugin Contributions:
0

Re: Show "in Stock" on 1 category

excellent! thanks. that fixed it. no idea how they got in there :)

15 Apr 2010, 5:21 PM
#17
ajeh avatar

ajeh

Oba-san

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

Re: Show "in Stock" on 1 category

Spookie ain't it? :eek:

Thanks for the update that this is now working for you ... :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!

24 May 2011, 8:53 PM
#18
giftmeister avatar

giftmeister

Zen Follower

Join Date:
Jan 2009
Location:
Montreal, Canada
Posts:
230
Plugin Contributions:
0

Re: Show "in Stock" on 1 category

Thanks, Linda. I played around and can't figure out- how can I make the stock show for just two specific categories?

Cheers,

R

24 May 2011, 10:58 PM
#19
ajeh avatar

ajeh

Oba-san

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

Re: Show "in Stock" on 1 category

If you wanted it to show for Category 10 and 9 you can use:

  <?php echo ((($current_category_id == 10 || $current_category_id == 9) && $flag_show_product_info_quantity == 1) ? '<li>' . $products_quantity . TEXT_PRODUCT_QUANTITY . '</li>'  : '') . "\n"; ?>

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!

25 May 2011, 9:33 PM
#20
giftmeister avatar

giftmeister

Zen Follower

Join Date:
Jan 2009
Location:
Montreal, Canada
Posts:
230
Plugin Contributions:
0

Re: Show "in Stock" on 1 category

That's it, thanks!