Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
I just installed this on a new site I am working on.
When I did the SPL query I got th1 error message and 1 note as follows:
Error: Cannot create table product_with _attributes_stock because it already exists ( I am assuming this is because I tried a diff mod for this earlier which uses the same table)
Note: 1 statement ignored. See upgrade exceptions table for additional details ( I assume this is because I wasn't upgrading)
I then proceeded to install the files which I did manually one at a time via FTP to make sure they were all uploaded correctly. The renamed the ones that would be overriden by adding a 1 at the end of the file name and then uploading the file of the same name. This way it will be easily undone.
Then I looked at the site http://www.cheechababy.com.au and it still looked the same so that was promising. I went to admin and the products with attributes stock option/tab is there.
I then added stock to a product (headbands) but only to the blush attribute. I then went to buy the cloud-blue for which I hadn't added any stock. I went to my cart and hit the checkout button but nothing happened, I tried again with the same result so I assume it is because that attribute has no stock so it's not allowing me to chekc it out. But it isn't telling anything.
So then I emtied the cart and added the blush attribute for which I had added 1 stock and when I went to checkout it came up with this error message:
Fatal error: Cannot redeclare class order in /home/cheechab/public_html/includes/classes/order.php on line 20
Obviously it has something to do line 20 on order.php which says this: class order extends base {
What's wrong with it?
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Is there any functionality available to restock the attributes when an order is deleted? An option appears to restock, but only the stock of the article is set back to the right value and not in the attributes stock.
I think the general.php in admin\includes\functions need to be changed?
Kuroi, is this a functionality you would like to build in?
We are selling clothes and a lot of orders are returned (clothes do not always fit) and then it is a lot of work to restock it manually.
Regards,
Bram:smile:
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
vivaraquel
I went to checkout it came up with this error message:
Fatal error: Cannot redeclare class order in /home/cheechab/public_html/includes/classes/order.php on line 20
Obviously it has something to do line 20 on order.php which says this: class order extends base {
What's wrong with it?
See posts 334-337 just above.
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
manage-it
Is there any functionality available to restock the attributes when an order is deleted? An option appears to restock, but only the stock of the article is set back to the right value and not in the attributes stock.
I think the general.php in admin\includes\functions need to be changed?
Kuroi, is this a functionality you would like to build in?
No. I'm afraid so., And no (please see post #1 in this thread).
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Thanks Kuroi, that did it. I had left the original order.php file ther just renamed it order1.php. Sounds absurd but hey, such are these things sometimes.
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
I would like to simpy add a stock of 1 for each attribute defined for a product. Is there an easy way to do this without going through the admin screen, selecting each attribute, adding 1, submitting and then going to the next attribute?
Cheers.
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Kuroi, can you give me a hand here?
I'm trying to modify the order history page, so that users can add the products from previous order back to cart.
The idea is to use the multiple add to cart form of Zen, then calculate the amount in stock of each products and draw an add-to-cart input form if the stock is available.
However, I'm having a hard time with the products that have attributes. In the orders_products table they are stored like this: id:attribute_string, ie:
19:1asdjaj1902ie9ajdaodj1092iasd
Do you have any idea how to know exactly which attribute id to get the stock?
Regards
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
@yellow1912
That can be done, though it's a bit complicated - no surprise there, I suspect.
Firstly, I don't believe that there's any encoding of attributes in the product_prid field used in order processing.
However there is a table dedicated to this, i.e. orders_products_attributes. Unfortunately it holds information frozen for display in the order history. It does this in case you change or delete your products after the order is completed. The customer will still be able to see details of what they purchased.
However, if you have changed or deleted a product, the customer would have a problem reloading it to their shopping cart anyway, so that's something you need to deal with, but not a show stopper.
So, your first step would be to work backwards from the products_options_values to get the relevant products_options_values_ids in the products_options_values table, then concatenate them as a common-separated string and search for that string in the stock_attributes field of the products_with_attributes_stock table.
If you find it all is fine. If you don't this could mean that the stock is being managed at product level, so you would need to check whether there are any other attribute combinations with stock for that product.
If there are, it would indicate that this attribute combination no longer exists for this product. If there are not, you would need to check whether there is a non-zero value for stock in the product table. If so, it would show that stock is being managed managed at the product level for this product.
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
barryboy
I would like to simpy add a stock of 1 for each attribute defined for a product. Is there an easy way to do this without going through the admin screen, selecting each attribute, adding 1, submitting and then going to the next attribute?
Depends what you call easy. I do this by either writing SQL scripts to bulk populate the attribute stock, or more frequently by creating spreadsheets for import to the table.
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Clarification
The following response to yellow1912 was rather badly worded ...
Quote:
Originally Posted by
kuroi
I don't believe that there's any encoding of attributes in the product_prid field used in order processing.
should have read
Quote:
I don't believe that there's any way of decoding attributes from the product_prid field used in order processing.
Apologies for any confusion.