Your Cart is currently empty!
Product update
Coupon
add
Coupon code invalid! Please re-enter!
AJAX loader
You are here: HomeForum
Welcome, Guest

Shown the number of stock for products virtuemart
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: Shown the number of stock for products virtuemart

Shown the number of stock for products virtuemart 11 years, 4 months ago #11128

How can I shown the number of stock for products virtuemart .
ex: in the product details I want to be drop-down list contain the number of stock available from 1 to stock quantity .
If I have (x) product and In Stock 4 . I want drop-down list contain :
1
2
3
4
and the customer can choose any number from the list as a quantity to buy the products
Please help me
Thank you
The topic has been locked.

Re: Shown the number of stock for products virtuemart 11 years, 4 months ago #11133

  • diepnt
  • OFFLINE
  • Platinum Boarder
  • Posts: 442
  • Karma: 8
Dear Motaz,

Could you please tell with us the name of template that you're using?

Thanks!
The topic has been locked.
The following user(s) said Thank You: msm_it@ymail.com

Re: Shown the number of stock for products virtuemart 11 years, 4 months ago #11136

Dear SA Nghiem Diep
I used SJ Jare template
Thank you
The topic has been locked.

Re: Shown the number of stock for products virtuemart 11 years, 4 months ago #11150

  • SA Thuy
Dear Motaz,

Please go to D:\xampp\htdocs\sj_jare\templates\sj_jare25\html\com_virtuemart\productdetails\default_addtocart.php and find:

$stockhandle = VmConfig::get ('stockhandle', 'none');
			if (($stockhandle == 'disableit' or $stockhandle == 'disableadd') and ($this->product->product_in_stock - $this->product->product_ordered) < 1) { ?>
				<a href="<?php echo JRoute::_ ('index.php?option=com_virtuemart&view=productdetails&layout=notify&virtuemart_product_id=' . $this->product->virtuemart_product_id); ?>" class="notify"><?php echo JText::_ ('COM_VIRTUEMART_CART_NOTIFY') ?></a>
			<?php } else { ?>
				
				<!-- <label for="quantity<?php echo $this->product->virtuemart_product_id; ?>" class="quantity_box"><?php echo JText::_ ('COM_VIRTUEMART_CART_QUANTITY'); ?>: </label> -->
				<span class="quantity-box">
					<input type="text" class="quantity-input js-recalculate" name="quantity[]" value="<?php if (isset($this->product->min_order_level) && (int)$this->product->min_order_level > 0) {
						echo $this->product->min_order_level;
					} else {
						echo '1';
					} ?>"/>
				</span>
				
				<span class="quantity-controls js-recalculate">
					<input type="button" class="quantity-controls quantity-plus"/>
					<input type="button" class="quantity-controls quantity-minus"/>
				</span>

=>
$stockhandle = VmConfig::get ('stockhandle', 'none');
			if (($stockhandle == 'disableit' or $stockhandle == 'disableadd') and ($this->product->product_in_stock - $this->product->product_ordered) < 1) { ?>
				<a href="<?php echo JRoute::_ ('index.php?option=com_virtuemart&view=productdetails&layout=notify&virtuemart_product_id=' . $this->product->virtuemart_product_id); ?>" class="notify"><?php echo JText::_ ('COM_VIRTUEMART_CART_NOTIFY') ?></a>
			<?php } else { 
			$number_products_remain=$this->product->product_in_stock - $this->product->product_ordered;
			?>
				
				<!-- <label for="quantity<?php echo $this->product->virtuemart_product_id; ?>" class="quantity_box"><?php echo JText::_ ('COM_VIRTUEMART_CART_QUANTITY'); ?>: </label> -->
				<span class="quantity-box">
				<?php 
				$i=1;
				if (isset($this->product->min_order_level) && (int)$this->product->min_order_level > 0 && $number_products_remain > ($this->product->min_order_level)){
				$i=$this->product->min_order_level;
				}else $i=1;?>
				<select name="quantity[]" class="quantity-input js-recalculate">
				<?php for($j=$i; $j<=$number_products_remain; $j++){ ?>
					<option value="<?php echo $j;?>"><?php echo $j;?></option>
					<?php }?>
				</select>	
				</span>


Thanks
The topic has been locked.

Re: Shown the number of stock for products virtuemart 11 years, 4 months ago #11171

Thank you
Thanks
Merciiiiiiiiiiiiii
The topic has been locked.
  • Page:
  • 1
Time to create page: 0.21 seconds

Notification

Please find your issue via Suggested Posts before submitting your question. We have solved the most of issues and maybe your issue was solved before.

Latest My Topics

No posts to display.

Love all our templates?

Join our membership clubs starting at $49 only for access to all of our templates

Join Now
Home Pricing
Your Cart is currently empty!
Product update
Coupon
add
Coupon code invalid! Please re-enter!
AJAX loader
SearchSupport
Magento Themes Magento Extensions Free Magento Extensions Prestashop Themes Prestashop Modules Magento 2 Themes