Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

quantity displayed & text status for some products...


elari

Recommended Posts

update is downloadable here

http://prdownloads.sourceforge.net/elari/q...12.zip?download

 

demo shop

http://www.unlockgsm.com/qty_staf/catalog/default.php

 

Now report stock as text or qty or both

Can force Out Of Stock in checkout or only not reporting qty

Updated products_new & new_products

 

work with old & new (nov) checkout snapshot

Link to comment
Share on other sites

  • Replies 64
  • Created
  • Last Reply

Top Posters In This Topic

First let me say thanks so much for this great idea :)

 

I have installed, and tweaked, and got it running nicely, i doubt i'm using it as it was intended but it does the job for me just fine. I have only got round to setting up the new_products.php layout so far, you can see it running at www.consoleplus.co.uk

 

but i have a problem, the admin side. categories.php is the problem, i have tried just dumping in the file from the contribution, but i get errors when modifying a product:

 

Fatal error: Call to undefined function: tep_get_uploaded_file() in /usr/home/consoleplus/public_html/catalog/admin/categories.php on line 521

 

 

i'm hoping i can just add this function, and all will be ok, as everything else seems to work just fine.

 

I did manually update my categories.php, but then i get errors again (i cant remember exactly, tep_get_image or something).

 

Basically i'm after the function tep_get_uploaded_file , or an idea where it comes from (i searched todays snapshot for the text 'tep_get_uploaded_file' and found nothing, so can only assume it is part of a contribution).

 

Any help greatly appreciated, and once again, that's for the great contribution :)

 

Regards

 

Matt

www.consoleplus.co.uk

Link to comment
Share on other sites

i think error can be in general.php

did you tryed to upload image or icon from other part of admin ?

 

tep_get_uploaded is used twice by original osc file not by the contrib

near line 520 is used to check upload image for new products and is standard osc code...

please check again your file

Link to comment
Share on other sites

Hey Matt

 

How much of the file did you tweak to get the layout that way?

I have been wanting to make my layout look like this for a while.

 

Did you do this or did this contribution make that layout?

 

Also, are you still using the short product description with this?

Cos I could never get that working...

I want it working in Featured_products.php aswell as new_products.php, but it proved near on impossible to do.

 

Can you let me know how much of this is quite easily done please?

I want my layout the same that is the main aim.

 

PM me if you dont wanna put it all on here.

Cheers mate, I know you have helped me a lot in the past, so hope you can now.

 

CC.

Link to comment
Share on other sites

  • 2 weeks later...

I installed this hack on new snapshot everything appears ok until I put display products quantity to 1 then i get this in my catalog

 

1109 - Unknown table 'p.products_quantity_display_allowedp' in field list

 

select pd.products_name, p.products_quantity, p.products_quantity_display_allowedp.products_quantity, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id = '23' order by pd.products_name limit 0, 20

 

[TEP STOP]

 

Need some input thanx for the cool mod, I cant wait to get it workin!!!

Link to comment
Share on other sites

cmon dude use those eyes.

Not to mention a little bit of nounce.

 

What do you think a profile is for??

 

Click profile, go to bottom of page... Voila!

 

Enjoy. But keep it clean.

 

CC.

Link to comment
Share on other sites

  • 1 month later...

I've just installed this contribution and I am getting an error in Admin. As follows:

 

Fatal error: Call to undefined function: tep_get_products_status_name() in /home/mgrundy/public_html/admin/categories.php on line 977

 

Line 977 reads:

 

$contents[] = array('text' => '<br>' . TEXT_PRODUCTS_DISPLAY_QUANTITY . tep_get_products_status_name($pInfo->products_quantity_display_allowed));

I don't know a whole lotta PHP and I'm a bit stuck! Any help would be appreciated!

 

Regards,

 

Marcus

Link to comment
Share on other sites

Ah yes! Note to self - read instructions properly!

 

Got that working but still having a slight problem getting it to display correctly. You say in your instructions that the breakout operator does not change in the admin and you need to edit the file. Which file and what do you change?

 

I am getting 'In stock' text for stock levels of 2 or less but 3 and above just give a '-'. Can you help? Is this related to the breakout operator?

 

Thanks again,

 

Marcus

Link to comment
Share on other sites

Hey Marcus

 

You site is looking very nice.

Good colour scheme, well laid out, neat, nice Job.

 

One thing tho, I would move that live helper box to the bottom of a column.

It looks so out of place there.

 

Love the logo too!

Did you do your own art work?

This is something I lack skill in, and so do my other work colleagues.

 

If you want to earn some cash on the side let me know, or if someone did your logo for you, let me know if they want some work.

 

BTW - Nice to see some loacl faces on here, I live about 10 minutes away from you in Blyth. Small world. :wink:

 

CC.

Link to comment
Share on other sites

the BREAKOUT QTY works well , by default it is set to 3 and can be changed in admin

 

Only The BREAKOUT OPERATOR is not working properly

look in the module like products_listing

 

there is some lines like

case 'PRODUCT_LIST_QUANTITY':

$lc_align = 'right';

//display qty

//it seems use of PRODUCTS_QUANTITY_BREAKOUT_OPERATOR no more work on my test server so i removed it and

//it need to set the breakout directly in file for instance :(

//Test logic is also change to test first if display qty in plain text and breakout is only second check

//if ($listing_values['products_quantity_display_allowed'] >= '0' && $listing_values['products_quantity_display_allowed'] . PRODUCTS_QUANTITY_BREAKOUT_OPERATOR . PRODUCTS_QUANTITY_BREAKOUT) {

// We check if in admin is enable display product stock status in clear text

if (PRODUCT_LIST_PRODUCTS_STATUS == 1 ) {

switch ($listing_values['products_quantity_display_allowed']) {

case '0':

// By default Red flag force to display Nothing as qty

// If you want to use Red Flag to set Always Out Of Stock uncomment next line

// Added 11 Nov 02 - Value PRODUCTS_QUANTITY_FORCE_OOS is set in admin / stock and

// will force out of stock in checkout process

if (PRODUCTS_QUANTITY_FORCE_OOS == 1 ) {

$lc_text = '<span style="color: #ff0000"> ' . tep_get_products_status_name(0) . '</span> ';

} else {

$lc_text = ' ';

}

break;

case '1':

//Display stock is allowed so we test the breakout qty. you must change operator manually in file

//by default qty will be dispalyed if less than 3 pcs and you can set green status to say something like "buy fast, only 2"

if ($listing_values['products_quantity'] < PRODUCTS_QUANTITY_BREAKOUT) {

 

in the last line the operator is fixed to be '<' and need to be changed accordingly what you want. in my first run the operator is PRODUCTS_QUANTITY_BREAKOUT_OPERATOR that is set in admin, but after i changed host it not worked anlymore the way i want so i removed it but you can try yourself it it work...

just replace

<

by

' . PRODUCTS_QUANTITY_BREAKOUT_OPERATOR . '

and look if it work...

 

however i plan to rewrite this hack to set the plain text status as a function in few time... (it will not change many work..)

 

if you change operator you'll have to check also in products_new, new_products, and catalog_products_with_images.php that is also included in last commit

Link to comment
Share on other sites

You site is looking very nice.

Good colour scheme, well laid out, neat, nice Job.

 

Cheers mate, I'm getting there slowly but surely, adding bits when I can!

 

I would move that live helper box to the bottom of a column.

It looks so out of place there.

 

I agree! I tried a contrib to put it inside an infobox at the side but just couldn't get it to work so I put it at the top just to get it on the page. Trouble is, without that at the top it looks really bare up there!

 

Love the logo too!

Did you do your own art work?

 

No, unfortunately not! I couldn't do it either so I got a mate of a mate to do it. Not sure if he'd do another though - it would cost an arm and a leg for his time!

 

BTW - Nice to see some local faces on here, I live about 10 minutes away from you in Blyth. Small world. :wink:

 

Where you from? PM if you like

 

Cheers,

 

Marcus

Link to comment
Share on other sites

Aarrghh! :shock: I've just gone to 'copy' a product in admin and I've been given the following error:

 

1136 - Column count doesn't match value count at row 1



insert into products (products_quantity, products_quantity_display_allowed , products_model,products_image, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('4', '', 'ms.gif', '59.9900', now(), '', '0.01', '0', '0', '21')



[TEP STOP]

 

Any ideas anyone?

 

Cheers,

 

Marcus

Link to comment
Share on other sites

ok

 

We used to have this problem, but I cant remember what cured it.

 

The best thing to do in the short term is instead of 'copy to', just 'link' the product.

This works fine.

 

Let me see if I can find out how we sorted it.

 

CC.

Link to comment
Share on other sites

seems is missing one value in the copy

you can

remove the row 'products_qty_disp_allowed'

or add a , '' , in the value after the vale of products_quantity

it will not copy the value of qty_disp_allow for instance...

 

or let me some time to recheck this problem (this afternoon, this moring i have no time) ..

 

this is to search in categories.php you'll find this line somewhere after a case 'copy'....

 

it works on my shop but i have had it a while ago

Link to comment
Share on other sites

strange my last answer not here so i repost it... seems it has gone in an other thread

 

 

find in categories something like

case 'copy_to_confirm':

if ( (tep_not_null($HTTP_POST_VARS['products_id'])) && (tep_not_null($HTTP_POST_VARS['categories_id'])) ) {

$products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);

$categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']);

 

if ($HTTP_POST_VARS['copy_as'] == 'link') {

if ($HTTP_POST_VARS['categories_id'] != $current_category_id) {

$check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . tep_db_input($products_id) . "' and categories_id = '" . tep_db_input($categories_id) . "'");

$check = tep_db_fetch_array($check_query);

if ($check['total'] < '1') {

tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . tep_db_input($products_id) . "', '" . tep_db_input($categories_id) . "')");

}

} else {

$messageStack->add_session(ERROR_CANNOT_LINK_TO_SAME_CATEGORY, 'error');

}

} elseif ($HTTP_POST_VARS['copy_as'] == 'duplicate') {

// ORIGINAL osc select

// $product_query = tep_db_query("select products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . tep_db_input($products_id) . "'");

// elari added CStatus_Discount_Allowed & Quantity_Display_Allowed

$product_query = tep_db_query("select products_quantity, products_quantity_display_allowed, products_model, products_image, products_price, products_discount_allowed, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . tep_db_input($products_id) . "'");

$product = tep_db_fetch_array($product_query);

 

// ORIGINAL osc insert

// tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model,products_image, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('" . $product['products_quantity'] . "', '" . $product['products_model'] . "', '" . $product['products_image'] . "', '" . $product['products_price'] . "', now(), '" . $product['products_date_available'] . "', '" . $product['products_weight'] . "', '0', '" . $product['products_tax_class_id'] . "', '" . $product['manufacturers_id'] . "')");

// elari added CStatus_Discount_Allowed & Quantity_Display_Allowed

// elari Added Qty Disp Allowed 'products_quantity_display_allowed' => tep_db_prepare_input($HTTP_POST_VARS['products_quantity_display_allowed']),

// elari Added Customers Status Max Discount Allowed by Product

 

tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_quantity_display_allowed, products_model,products_image, products_price, products_discount_allowed, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('" . $product['products_quantity'] . "', '" . $product['products_model'] . "', '" . $product['products_image'] . "', '" . $product['products_price'] . "', '" . $product['products_discount_allowed'] . "', now(), '" . $product['products_date_available'] . "', '" . $product['products_weight'] . "', '0', '" . $product['products_tax_class_id'] . "', '" . $product['manufacturers_id'] . "')");

 

and replace last line by

 

tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_quantity_display_allowed, products_model,products_image, products_price, products_discount_allowed, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('" . $product['products_quantity'] . "', '" . $product['products_quantity_display_allowed'] . "','" . $product['products_model'] . "', '" . $product['products_image'] . "', '" . $product['products_price'] . "', '" . $product['products_discount_allowed'] . "', now(), '" . $product['products_date_available'] . "', '" . $product['products_weight'] . "', '0', '" . $product['products_tax_class_id'] . "', '" . $product['manufacturers_id'] . "')");
Link to comment
Share on other sites

It will work, but not with the standard code.

 

For instance this:

products_discount_allowed

 

Is not in the standard code.

So be careful you dont add parts you dont need!

 

Dont do a straight copy past.

 

CC.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...