Post by phpjunkie » Tue May 06, 2014 4:19 pm

Hello all,

Brand new to the OpenCart community, so a big HELLO here from a new member! :)

Right now I'm running into an issue, and it's most likely just not knowing enough about OpenCart and how to properly setup products with fixed inventory levels, and more specifically fixed inventory for OPTIONS.

Let me explain in more detail...
  • This is a SPORTS related site, and will be selling products directly related to US sports teams (MLB, NFL, NHL, etc..).
  • So using baseball as an example with 30 MLB teams, what I've done so far was created a Catalog Select (drop-down) OPTION called "MLB Teams", which will be reusable on multiple products with the listing of all 30 baseball teams.
  • I then created a new Product, let's just say it's "MLB Team Jersey" for simplicity sake
  • Now what I want to do is add ONE (1) piece of inventory for each MLB team. (One piece being the key here, as there will almost never be more than one per given team)
  • So in Catalog>Products --> I've chosen to Edit the "MLB Team Jersey" product, and selected the OPTIONS tab
  • On this tab, I've added 30 options (one for each MLB team), and selected the appropriate drop-down for each team
  • Additionally, I've added the value of ONE (1) on each of these options in the Quantity column
Now here's where I'm stuck...

In Admin, within the Product in question -- If I choose to put ZERO (0) stock on the Data tab, and only use the stock value on the individual options (team names), I receive the following on the Shopping Cart page when I've added one of these products to the cart:

Products marked with *** are not available in the desired quantity or not in stock!

Although the cart is allowing me to add this product, which I do want -- because I'm ideally looking to manage quantity at the individual team level. But I certainly don't want the error message.

ALSO, and this is an even bigger issue... OpenCart does seem to allow me to add multiple QTY values for an item, even though I've specifically hard-coded a quantity of ONE (1) for each team.

Example: I've hard set a Quantity of 1 in NY Yankees Team Jersey. Now when I add this product to my cart, and choose a quantity of 10, the cart IS allowing me to do this, which is not the behavior I'm looking for.

I certainly hope these aren't limitations to OpenCart that cannot be overcome, but rather just my own learning curve.

Any help or suggestions would be greatly appreciated!

Newbie

Posts

Joined
Tue May 06, 2014 3:44 pm

Post by grgr » Tue May 06, 2014 11:59 pm

Because it is a product with options what you want to do is set it to 1 (or any other number) and then set it to 'Subtract Stock: No' for the main product (data tab).

In the options, add quantites of 1 which you have done and then 'Subtract Stock: Yes'.

As for the adding more to cart than 1 item, I have an extension that might work for you, try the demos: http://www.opencart.com/index.php?route ... n_id=13703

-
Image Image Image
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by phpjunkie » Fri May 09, 2014 12:03 pm

grgr wrote:Because it is a product with options what you want to do is set it to 1 (or any other number) and then set it to 'Subtract Stock: No' for the main product (data tab).

In the options, add quantites of 1 which you have done and then 'Subtract Stock: Yes'.

As for the adding more to cart than 1 item, I have an extension that might work for you, try the demos: http://www.opencart.com/index.php?route ... n_id=13703

Thank you for your reply grgr -- much appreciated. I'm afraid that I'm still stuck however.

Here's where I'm at:

1. Followed your instruction, and set the overall product Quantity (in DATA tab) to 30 -- which represents the full stock value (30 total pieces). And also set the "Subtract Stock" value to "No" (see below)
Image

2. In the Product itself, under Options - I manually set the Quantity one of my Sports Teams stock values down to "0", but made sure the "Subtract Stock" value is at "Yes". (see below)
Image

However, when I visit this product in my store I'm still showing "Availability:30"

Here's the page: http://www.sportsboxbreaks.com/2014-bow ... ose-team-1

I was assuming that the Availability should drop down to "29", but maybe I'm still doing something wrong? Or maybe an actual sale does have to be processed for the Product page to represent a deduction in stock value?

Again, any/all help is GREATLY appreciated.

Newbie

Posts

Joined
Tue May 06, 2014 3:44 pm

Post by grgr » Sat May 10, 2014 8:46 pm

You don't need to have 30 as the main product stock if you turn off the 'show stock' setting in the admin, you can set it as anything and have Subtract Stock set to No for the main product. You may as well turn it off as it is meaningless to you and your customers and saves you having to calculate it/enter it.

When an order is placed stock is deducted from the main product and the option if both are set to Yes.

If you set the main product to No then only the option stock will be deducted.

The stock figures are independant of each other.

-
Image Image Image
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by phpjunkie » Sat May 10, 2014 9:21 pm

grgr wrote:You don't need to have 30 as the main product stock if you turn off the 'show stock' setting in the admin, you can set it as anything and have Subtract Stock set to No for the main product. You may as well turn it off as it is meaningless to you and your customers and saves you having to calculate it/enter it.

When an order is placed stock is deducted from the main product and the option if both are set to Yes.

If you set the main product to No then only the option stock will be deducted.

The stock figures are independant of each other.
Thanks for the quick response! And I think I finally get it now, and it probably does make sense to turn off the "Show Stock" setting -- and just use the option stock set to YES.

My thought on using "Show Stock" really stemmed from another product I will have on the site, where the customer is buying a RANDOM team spot, and not a specific team.

So for instance with MLB, there will be 30 pieces of inventory available globally -- not broken out into team options. For this type of product, I thought it would be helpful to the customer (and possibly to sales) to display stock setting. Here's an example:

http://www.sportsboxbreaks.com/2014-bow ... dom-team-1

But of course the "Show Stock" setting is a global setting, as I can't really set this on a per-product level.

Newbie

Posts

Joined
Tue May 06, 2014 3:44 pm

Post by grgr » Sat May 10, 2014 10:03 pm

You could leave it on but just mask it. If those other products don't have options then you simply hide the stock amounts for products that do have options by wrapping the stock availability in a bit of code:

<?php if (!$options) { ?>
<?php if ($show_stock } ?>
<?php echo $show_the_stock; ?>
<?php } ?>
<?php } ?>

you would do that in the product.tpl file.

Above isn't actual working code/correct variable names, just example of what to do!

-
Image Image Image
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK
Who is online

Users browsing this forum: Bing [Bot], Majestic-12 [Bot], o3445 and 86 guests