Jump to content
Sign in to follow this  
Snowman

[Contribution]Product Availability Options v1.0

Recommended Posts

Double check with this code

 

In catalog/products_info.php

 

find the the following code:

 

 

<?php
?} else {
? ?$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
? ?$product_info = tep_db_fetch_array($product_info_query);

 

and change to

 

<?php
?} else {
? ?$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, ?p.products_availability_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
? ?$product_info = tep_db_fetch_array($product_info_query);

You didn't put that part in installation guide. *double checks* yup. you didn't, at least in 1.02a documentation.

Share this post


Link to post
Share on other sites
if found the error now!

but i cannot correct it easily.

 

the problem was/is:

the contrib is in english.

we use english and german.

the file products_availability was just filled with the delivered english sql,

so of course no german-availability can show/can be read if it is not in the database... :-(

 

i tried to add the german info, but....

 

can it be that all you people run your shop in english only?

 

seems to me there is 'error in logic' in the construction of the file products_availability

? PRIMARY KEY? (`products_availability_id`),

 

how should i add the german info?

 

i cannot just change:

INSERT INTO `products_availability` VALUES (1, 1, 'Usually ships in 24 hours', now(), NULL);

INSERT INTO `products_availability` VALUES (4, 1, 'Usually ships in 1-2 business days', now(), NULL);

 

to:

INSERT INTO `products_availability` VALUES (1, 2, 'innerhalb von 24 Stunden', now(), NULL);

INSERT INTO `products_availability` VALUES (4, 2, 'innerhalb von 1-2 Arbeitstagen', now(), NULL);

 

because the key (1, 4, ...) is already existing...

 

i guess the key should either be an automatically increasing number,

or should consist of a combination of key+languages_id

 

what solution do you propose?

 

Thanks for your efforts!

I am with the same problem, I have 3 languages in my website, and the values for non english languages are not store in database.

 

How to solve this problem?

 

Best Regards

Andre.

Share this post


Link to post
Share on other sites

The problem is in the database, and how the PHP code works with SQL, I think.

 

The admin of this contribution is based on the manufactors "module"

 

And Lena should be right, the manufactors SQL code for 3 laguages in my case is this:

 

#

# Dumping data for table `manufacturers_info`

#

 

INSERT INTO `manufacturers_info` VALUES (1, 1, 'http://www.matrox.com', 0, NULL);

INSERT INTO `manufacturers_info` VALUES (2, 1, 'http://www.microsoft.com', 0, NULL);

INSERT INTO `manufacturers_info` VALUES (3, 1, 'http://www.warner.com', 0, NULL);

INSERT INTO `manufacturers_info` VALUES (4, 1, 'http://www.fox.com', 0, NULL);

INSERT INTO `manufacturers_info` VALUES (5, 1, 'http://www.logitech.com', 0, NULL);

INSERT INTO `manufacturers_info` VALUES (6, 1, 'http://www.canon.com', 0, NULL);

INSERT INTO `manufacturers_info` VALUES (7, 1, 'http://www.sierra.com', 0, NULL);

INSERT INTO `manufacturers_info` VALUES (8, 1, 'http://www.infogrames.com', 0, NULL);

INSERT INTO `manufacturers_info` VALUES (9, 1, 'http://www.hewlettpackard.com', 0, NULL);

INSERT INTO `manufacturers_info` VALUES (1, 2, 'http://www.matrox.com', 0, NULL);

INSERT INTO `manufacturers_info` VALUES (2, 2, 'http://www.microsoft.com', 0, NULL);

INSERT INTO `manufacturers_info` VALUES (3, 2, 'http://www.warner.com', 0, NULL);

INSERT INTO `manufacturers_info` VALUES (4, 2, 'http://www.fox.com', 0, NULL);

INSERT INTO `manufacturers_info` VALUES (5, 2, 'http://www.logitech.com', 0, NULL);

INSERT INTO `manufacturers_info` VALUES (6, 2, 'http://www.canon.com', 0, NULL);

INSERT INTO `manufacturers_info` VALUES (7, 2, 'http://www.sierra.com', 0, NULL);

INSERT INTO `manufacturers_info` VALUES (8, 2, 'http://www.infogrames.com', 0, NULL);

INSERT INTO `manufacturers_info` VALUES (9, 2, 'http://www.hewlettpackard.com', 0, NULL);

INSERT INTO `manufacturers_info` VALUES (1, 3, 'http://www.matrox.com', 0, NULL);

INSERT INTO `manufacturers_info` VALUES (2, 3, 'http://www.microsoft.com', 0, NULL);

INSERT INTO `manufacturers_info` VALUES (3, 3, 'http://www.warner.com', 0, NULL);

INSERT INTO `manufacturers_info` VALUES (4, 3, 'http://www.fox.com', 0, NULL);

INSERT INTO `manufacturers_info` VALUES (5, 3, 'http://www.logitech.com', 0, NULL);

INSERT INTO `manufacturers_info` VALUES (6, 3, 'http://www.canon.com', 0, NULL);

INSERT INTO `manufacturers_info` VALUES (7, 3, 'http://www.sierra.com', 0, NULL);

INSERT INTO `manufacturers_info` VALUES (8, 3, 'http://www.infogrames.com', 0, NULL);

INSERT INTO `manufacturers_info` VALUES (9, 3, 'http://www.hewlettpackard.com', 0, NULL);

 

Lena, do you tried to do the INSERTS?

 

 

It works?

 

 

Regards

Andre'.

Edited by lopes_andre

Share this post


Link to post
Share on other sites

I "think" I know the problem.

 

I have see the working of the /admin/manufacturers.php and how it works, this module is based on this manufacturers.php.

 

 

The manufacturers.php works with 2 SQL tables.

 

Table "manufacturers_info" relates "manufacturers_id" with "languages_id"

 

And

 

Table "manufacturers" relates "manufacturers_id" with "manufacturers_name"

 

 

In the SQL modification of this contribution(Product Availability) I think we have to create another Table to have other languages... relating "products_availability_id" with "laguages_id", in this contribution we have only one table created.

 

I will be wait for Steve solution, i am not a programmer :)

 

 

Best Regards

Andre'.

Share this post


Link to post
Share on other sites

Thank you Steve. One more time.

 

The mod is now installed and working in 3 languages :D

 

 

Regards,

Andre.

Edited by lopes_andre

Share this post


Link to post
Share on other sites

Ah great...im glad to here ive finally got it right :)

 

Ok onto the next mod :)

Share this post


Link to post
Share on other sites

Hi Steve,

 

Thanks for this mod! I've got it working correctly in my store, BUT in the /admin/localization area, when I click on 'Product Availability' it tries to link to this URL:

 

https://www.mydomain.com/catalog/admin/FILE...TS_AVAILABILITY

 

which returns a 404/Page Not Found error.

 

I have no idea what's causing this. What should this be linking to? (admin/products_availability.php?)

 

Any ideas on how I can fix this? Many thanks in advance!

 

TerryK


Terry Kluytmans

 

Contribs Installed: Purchase Without Account (PWA); Big Images, Product Availability, Description in Product Listing, Graphical Infobox, Header Tags Controller, Login Box, Option Type Feature, plus many layout changes & other mods of my own, like:

 

Add order total to checkout_shipment

Add order total to checkout_payment

Add radio buttons at checkout_shipping (for backorder options, etc.)

Duplicate Table Rate Shipping Module

Better Product Review Flow

 

* If at first you don't succeed, find out if there's a prize for the loser. *

Share this post


Link to post
Share on other sites

you havent added the file identification to the admin/includes/filenames.php file :)

Share this post


Link to post
Share on other sites

Thanks, Steve!!!

 

(Actually, I *had* added it, but not to the file in my working directory... duh).

 

Thanks again -- this is a great mod!

 

Terry


Terry Kluytmans

 

Contribs Installed: Purchase Without Account (PWA); Big Images, Product Availability, Description in Product Listing, Graphical Infobox, Header Tags Controller, Login Box, Option Type Feature, plus many layout changes & other mods of my own, like:

 

Add order total to checkout_shipment

Add order total to checkout_payment

Add radio buttons at checkout_shipping (for backorder options, etc.)

Duplicate Table Rate Shipping Module

Better Product Review Flow

 

* If at first you don't succeed, find out if there's a prize for the loser. *

Share this post


Link to post
Share on other sites

Now that this is working the way it's supposed to, I have one more question:

 

Is there any way to carry the availability text over to the shopping cart checkout page, so the customer can see at a glance what's in and what's not? (Just in case they have a memory as short as mine is!)

 

TIA,

 

Terry


Terry Kluytmans

 

Contribs Installed: Purchase Without Account (PWA); Big Images, Product Availability, Description in Product Listing, Graphical Infobox, Header Tags Controller, Login Box, Option Type Feature, plus many layout changes & other mods of my own, like:

 

Add order total to checkout_shipment

Add order total to checkout_payment

Add radio buttons at checkout_shipping (for backorder options, etc.)

Duplicate Table Rate Shipping Module

Better Product Review Flow

 

* If at first you don't succeed, find out if there's a prize for the loser. *

Share this post


Link to post
Share on other sites

I' ve installed "product availability v. 1.03" and all works fine, just a little problem:

when i change the availability options and click "update" the status of the product change in "off".

 

Who have any ideas?

 

ThankYou!

Share this post


Link to post
Share on other sites

This is a fantastic mod, but I have an error, if I try to launch any product_info.php

 

1146 - Table 'digilabor_net_-_oscommerce.TABLE_PRODUCTS_AVAILABILITY' doesn't exist

select e.products_availability_name from TABLE_PRODUCTS_AVAILABILITY e where e.products_availability_id = '0' and e.language_id = '1'

[TEP STOP]

 

Any idea?

Share this post


Link to post
Share on other sites

Sorry for this, everything's fine! Forget my post above!

[just forgot to upload database_tables.php]

Share this post


Link to post
Share on other sites

Hi

 

Is there a way to change the product listing so that instead of QTY it would show availability.

 

I have successfully configured the availability module and it displays when you click on the product - but I would like where you get a list of products rather than to see Qty to see 'in stock', 'out of stock', 'special order' etc

 

I can't actually work out where it defines the titles and columns for that display.

 

 

Christine

Share this post


Link to post
Share on other sites

Cool contribution. Is there a way to combine this and Stock Status ?

 

That way the status of the product that goes to zero quantity would automatically be marked as 'out of stock'. That would be very handy especially for the people who come to the product page from search engine or outside link even if the product is out of stock. They would see 'out of stock' instead of 'shipping in 2 days' for example.

Share this post


Link to post
Share on other sites

I am getting the following error message when I try to edit a product from the admin section. I have carefully uploaded all the files, updated the db and double checked my installation to match the installation instructions:

 

1146 - Table 'abcmed_osc1.TABLE_PRODUCTS_AVAILABILITY' doesn't exist

select products_availability_id, products_availability_name from TABLE_PRODUCTS_AVAILABILITY order by products_availability_name

[TEP STOP]

 

 

I have checked my database and the table products_availability does exist. I appreciate any help.

 

Scotty

Edited by Scotty

Share this post


Link to post
Share on other sites
I am getting the following error message when I try to edit a product  from the admin section. I have carefully uploaded all the files, updated the db and double checked my installation to match the installation instructions:

 

1146 - Table 'abcmed_osc1.TABLE_PRODUCTS_AVAILABILITY' doesn't exist

select products_availability_id, products_availability_name from TABLE_PRODUCTS_AVAILABILITY order by products_availability_name

[TEP STOP]

I have checked my database and the table products_availability does exist. I appreciate any help.

 

Scotty

 

Check the database.php files to make sure youve added the database tables into them.

 

I will be revisiting this module shortly and will be releasing a bugfixed version shortly afterwards.

Share this post


Link to post
Share on other sites

Hi,

can anyone point me in the right direction? I get this error when I try to add an availability option through my admin:

1054 - Unknown column 'languages_id' in 'field list'

 

insert into products_availability (products_availability_name, products_availability_id, languages_id, date_added) values ('h', '', '1', now())

 

[TEP STOP]

What file(s) do I need to be looking into to find an error? Or...alternatively, can I manually create new availability options in the database somehow..?

 

thanks for any help or enlightenment! :D


Beautiful design is everything...the rest is just details!!

Share this post


Link to post
Share on other sites

Is there meant to be a product availability option in the admin tree?


For my contribution (to society) see my profile link.

--

my new charity store features: STSv4.5.2 and HTCv2.6.3 Bundle, Australian Post Shipping, Paymate, Category Trees Minimum Order Quantity, Enable/Disable Categories, Super Download Store, Paypal IPN, Free Dowloads, Anti-Robot Registration 2.6, Master Products, Lightbox for STS ... the rebuild continues...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×