Author Topic: Updating number of items in stock automatically  (Read 5434 times)

NigC

  • Beginner
  • *
  • Posts: 14
Re: Updating number of items in stock automatically
« Reply #15 on: September 17, 2010, 09:31:17 am »
Glad to help. Fingers crossed it works out :)

No need for a bottle of wine. If it's all OK, I'll just take a virtual pint ;D

WJM

  • Beginner
  • *
  • Posts: 13
Re: Updating number of items in stock automatically
« Reply #16 on: September 20, 2010, 06:17:36 am »
I have ten pages of codes but I don't see the following code: $list .= "product_thumb_image,product_s_desc ";

I understand the logic of placing 'product_in_stock' in various positions, but since I don't understand the code I don't know where exactly to place the product in stock code.

My code is atttached if you could have a look at it...


[attachment cleanup by admin]

NigC

  • Beginner
  • *
  • Posts: 14
Re: Updating number of items in stock automatically
« Reply #17 on: September 20, 2010, 09:18:27 am »
Hmmmm. Guess I should have checked the date of that thread - 2005 probably means it's a little out of date ::)

But looking at your code, it looks like what you need is already there. So all you need to do is go straight to step 5:

5) Now put {product_in_stock} in your browse_n flypage(s) where you want the stock message to appear.

I've just checked and yes it does work. Just insert this bit of code into your flypage where you want the stock level to show:
Code: [Select]
<?php echo $product_in_stock ?>

WJM

  • Beginner
  • *
  • Posts: 13
Re: Updating number of items in stock automatically
« Reply #18 on: September 20, 2010, 09:40:44 am »
Nigel,

I am wondering; am I really this dumb?? The answer is right in front of me, yet when I copy and paste {product_in_stock} into my flypage it still doesn't show the stock level.

So I tried copying the other code <?php echo $product_in_stock ?> and it still doesn't work. Then I changed the symbols, thinking it may not have been copied properly, so I copy the code like this: {?php echo $product_in_stock ?} - no luck.

I tried deleting the extra spaces one by one, but that didn't change a thing either.

Do I understand you instructions correctly? I just need to copy and paste the code into the flypage, so I do not need to mess around with the code that I attached?

Does it just work like simplecaddy, where you just insert this code {simplecaddy code=XYZ}into a page an voila it appears with the price?

I need to know where I am going wrong here.

I can't believe you're still helping me!! Thanks so much :)

NigC

  • Beginner
  • *
  • Posts: 14
Re: Updating number of items in stock automatically
« Reply #19 on: September 20, 2010, 10:13:35 am »
The code I gave you is correct, but maybe you're not putting it into the correct document???

In my Virtuemart installation, the file I need to edit is here:

components/com_virtuemart/themes/default/templates/product_details/flypage.tpl.php

If you're using a different template, you will need to replace "default" with the template name that you are using.

You'll just need to insert the code into the html wherever you need the figure to appear. It may take a bit of experimenting to get it in the right place.

Hope that helps.

mark R

  • Jr. Member
  • **
  • Posts: 220
Re: Updating number of items in stock automatically
« Reply #20 on: October 01, 2010, 22:51:01 pm »
I update my stock via a csv file containing my SKU and Stock Quantity, and a PHP script which is run via cron on a daily basis.
http://forum.virtuemart.net/index.php?topic=70026.0
Seek and ye shall find.........
4 VM sites and counting