bloccare ordini se manca la disponibilità

Questo forum è dedicato alle discussioni riguardanti le contribution per osCommerce

Moderatore: mod Generali

Rispondi
Avatar utente
elvinomac
membro Senior
membro Senior
Messaggi: 331
Iscritto il: 24/05/2005, 20:39
Località: Vicenza
Contatta:

bloccare ordini se manca la disponibilità

Messaggio da elvinomac »

So che se ne è parlato recentemente, ma non trovo il topic...

C' è una contrib per bloccare gli ordini se la disponibilità è 0.

Qualcuno se la ricorda?
Ho cercato, ma niente...

Grazie

Ciauz
Elvino
Bass
membro Master
membro Master
Messaggi: 3593
Iscritto il: 18/04/2004, 0:00
Località: Varese
Contatta:

Re: bloccare ordini se manca la disponibilità

Messaggio da Bass »

elvinomac ha scritto: Qualcuno se la ricorda?

No stock no checkout


'iao

Sergio
http://www.oscomtemplate.com - E' disponibile il nuovo pacchetto free con forum di supporto

http://www.semilandia.it
Avatar utente
elvinomac
membro Senior
membro Senior
Messaggi: 331
Iscritto il: 24/05/2005, 20:39
Località: Vicenza
Contatta:

Messaggio da elvinomac »

installata, ma la modifica in includes/modules/product_listing.php
non funziona...
premetto che ho installata la B2B anche se non centra niente secondo me.

la linea incriminata è:

Codice: Seleziona tutto

	 if ($listing['products_quantity']<=0) {
	   $lc_text = tep_image_button('button_buy_now_na.gif', IMAGE_BUTTON_BUY_NOW_NA) . ' ';
	 } else {
	   $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';
 
non riconosce la quantità... pur essendoci prodotti, mette sempre la prima ipotesi... "IMAGE_BUTTON_BUY_NOW_NA"

Booo!?

Ciauz
Elvino
Bass
membro Master
membro Master
Messaggi: 3593
Iscritto il: 18/04/2004, 0:00
Località: Varese
Contatta:

Messaggio da Bass »

elvinomac ha scritto:installata, ma la modifica in includes/modules/product_listing.php
non funziona...
Strano a me funziona benissimo...

'iao

Sergio
http://www.oscomtemplate.com - E' disponibile il nuovo pacchetto free con forum di supporto

http://www.semilandia.it
marulanda
membro Regular
membro Regular
Messaggi: 125
Iscritto il: 29/10/2005, 12:04
Contatta:

Messaggio da marulanda »

anche a me va benissimi prova a reinstallare!
CIAO
marulanda
membro Regular
membro Regular
Messaggi: 125
Iscritto il: 29/10/2005, 12:04
Contatta:

Messaggio da marulanda »

installata, ma la modifica in includes/modules/product_listing.php
non funziona...
La modifica o meno di questo file non inficia l'efficacia del contributo serve a togliere la colonna quantità dall'elenco dei prodotti.
Se resta così com'è cmq a quantità=0 il contr. impedisce lostesso l'acquisto.

Se penzi che sia lì il problema lascia il file originale, e vedi come va!
se tutto il resto è a posta ottieni comunque il risultato voluto.
RICIAOOO
Avatar utente
elvinomac
membro Senior
membro Senior
Messaggi: 331
Iscritto il: 24/05/2005, 20:39
Località: Vicenza
Contatta:

Messaggio da elvinomac »

serve anche a sostituire il bottone compra ora con qualcosa altro se la quantità è <=0 inferiore o uguale a zero.
Ma anche se il prodotto è in quantità 2-4- superiore a 0, il risultato è sempre che fa sparire il bottone compra...

Ho risolto in parte, eliminando la colonna "compra ora" da admin -> configurazione -> product listing -> Display Buy Now column

Ciauz
Elvino
marulanda
membro Regular
membro Regular
Messaggi: 125
Iscritto il: 29/10/2005, 12:04
Contatta:

Messaggio da marulanda »

io mi riferivo solo al contenuto del file product_listing.php :D :D .
Avatar utente
elvinomac
membro Senior
membro Senior
Messaggi: 331
Iscritto il: 24/05/2005, 20:39
Località: Vicenza
Contatta:

Messaggio da elvinomac »

sto parlando di quello infatti...

Ciauz
Elvino
marulanda
membro Regular
membro Regular
Messaggi: 125
Iscritto il: 29/10/2005, 12:04
Contatta:

Messaggio da marulanda »

mi sa che parliamo ma nn ci capiamo :D :D

Codice: Seleziona tutto

\catalog\product_info.php
line 213
                <td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>
-------------------------------
replace with...
                <?php 
	       if ($product_info['products_quantity'] <=0) { ?>
	         <td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_button('button_in_cart_na.gif', IMAGE_BUTTON_IN_CART_NA); ?></td>
	         <?php 
	       } else { ?>
	         <td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>
	         <?php 
	       } ?>

=========================================================

\catalog\product_reviews.php
line 15
  $product_info_query = tep_db_query("select p.products_id, p.products_model, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
-------------------------------
replace with...
  $product_info_query = tep_db_query("select p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");

-------------------------------

line 190
  echo '<p><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now') . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a></p>';
-------------------------------
replace with...
  if ($product_info['products_quantity'] <=0) {
    echo tep_image_button('button_in_cart_na.gif', IMAGE_BUTTON_IN_CART_NA);
  } else {
    echo '<p><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now') . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a></p>';
  }

=========================================================

\catalog\product_reviews_info.php
line 28
  $review_query = tep_db_query("select rd.reviews_text, r.reviews_rating, r.reviews_id, r.customers_name, r.date_added, r.reviews_read, p.products_id, p.products_price, p.products_tax_class_id, p.products_image, p.products_model, pd.products_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where r.reviews_id = '" . (int)$HTTP_GET_VARS['reviews_id'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "' and r.products_id = p.products_id and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '". (int)$languages_id . "'");
-------------------------------
replace with...
  $review_query = tep_db_query("select rd.reviews_text, r.reviews_rating, r.reviews_id, r.customers_name, r.date_added, r.reviews_read, p.products_id, p.products_quantity, p.products_price, p.products_tax_class_id, p.products_image, p.products_model, pd.products_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where r.reviews_id = '" . (int)$HTTP_GET_VARS['reviews_id'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "' and r.products_id = p.products_id and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '". (int)$languages_id . "'");

-------------------------------

line 144
  echo '<p><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now') . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a></p>';
-------------------------------
replace with...
  if ($review['products_quantity'] <=0) {
    echo tep_image_button('button_in_cart_na.gif', IMAGE_BUTTON_IN_CART_NA);
  } else {
    echo '<p><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now') . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a></p>';
  }

=========================================================

\catalog\product_reviews_write.php
line 20
  $product_info_query = tep_db_query("select p.products_id, p.products_model, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
-------------------------------
replace with...
  $product_info_query = tep_db_query("select p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");

-------------------------------

line 209
  echo '<p><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now') . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a></p>';
-------------------------------
replace with...
  if ($product_info['products_quantity'] <=0) {
    echo tep_image_button('button_in_cart_na.gif', IMAGE_BUTTON_IN_CART_NA);
  } else {
    echo '<p><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now') . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a></p>';
  }

=========================================================

\catalog\products_new.php
line 56
  $products_new_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added DESC, pd.products_name";
-------------------------------
replace with...
  $products_new_query_raw = "select p.products_id, p.products_quantity, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added DESC, pd.products_name";

-------------------------------

line 90
            <td align="right" valign="middle" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_new['products_id']) . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a>'; ?></td>
-------------------------------
replace with...
	 <?php 
	   if ($products_new['products_quantity'] <=0) { ?>
	     <td align="right" valign="middle" class="main"><?php echo  tep_image_button('button_in_cart_na.gif', IMAGE_BUTTON_IN_CART_NA) ; ?></td>
	     <?php 
	   } else { ?>
	     <td align="right" valign="middle" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_new['products_id']) . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a>'; ?></td>
	     <?php 
	   } ?>

-------------------------------
**Note about line 92**
Correct the spelling of "colspan".

=========================================================

\catalog\includes\languages\english.php
after line 252
define('IMAGE_BUTTON_BUY_NOW', 'Buy Now');

-------------------------------
insert...
define('IMAGE_BUTTON_BUY_NOW_NA', 'Not Available');

-------------------------------

after line 262
define('IMAGE_BUTTON_IN_CART', 'Add to Cart');
-------------------------------
insert...
define('IMAGE_BUTTON_IN_CART_NA', 'Not Available');

=========================================================

\catalog\includes\modules\product_listing.php
line 133
            $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';
-------------------------------
replace with...
	 if ($listing['products_quantity']<=0) {
	   $lc_text = tep_image_button('button_buy_now_na.gif', IMAGE_BUTTON_BUY_NOW_NA) . ' ';
	 } else {
	   $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';
            }

=========================================================

// Mod by Eric Haskins http://www.rackspeed.net eric.haskins@rackspeed.net
// To Allow this mod to work without displaying Quantity in listing

\catalog\includes\modules\product_listing.php
line 46

   case 'PRODUCT_LIST_QUANTITY':
        $lc_text = TABLE_HEADING_QUANTITY;
        $lc_align = 'right';
        break;
--------------------------------
replace with:
      // Mod for Not Showing Quantity with No Stock No CheckOut
      //$lc_text = TABLE_HEADING_QUANTITY;
        $lc_text = '';
        $lc_align = 'right';
        break;
--------------------------------

line 115

   case 'PRODUCT_LIST_QUANTITY':
            $lc_align = 'right';
            $lc_text = ' ' . $listing['products_quantity'] . ' ';
            break;
--------------------------------
replace with:
   case 'PRODUCT_LIST_QUANTITY':
           $lc_align = 'right';
        // Mod for Not Showing Quantity with No Stock No CheckOut
       //  $lc_text = ' ' . $listing['products_quantity'] . ' ';
           $lc_text = '  ';
           break;
==========================================================
// End Eric Haskins Mod

Io mi riferisco all'ultima modifica quella commentata.
Cmq è stranissimo che non funzioni mi dispiace di non poterti aiutate :(
Avatar utente
elvinomac
membro Senior
membro Senior
Messaggi: 331
Iscritto il: 24/05/2005, 20:39
Località: Vicenza
Contatta:

Messaggio da elvinomac »

e le righe prima?

Codice: Seleziona tutto

=========================================================



\catalog\includes\modules\product_listing.php

line 133

            $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';

-------------------------------

replace with...

	 if ($listing['products_quantity']<=0) {

	   $lc_text = tep_image_button('button_buy_now_na.gif', IMAGE_BUTTON_BUY_NOW_NA) . ' ';

	 } else {

	   $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';

            }



=========================================================



// Mod by Eric Haskins http://www.rackspeed.net eric.haskins@rackspeed.net

// To Allow this mod to work without displaying Quantity in listing



\catalog\includes\modules\product_listing.php

line 46



   case 'PRODUCT_LIST_QUANTITY':

        $lc_text = TABLE_HEADING_QUANTITY;

        $lc_align = 'right';

        break;

--------------------------------

replace with:

      // Mod for Not Showing Quantity with No Stock No CheckOut

      //$lc_text = TABLE_HEADING_QUANTITY;

        $lc_text = '';

        $lc_align = 'right';

        break;

--------------------------------



line 115



   case 'PRODUCT_LIST_QUANTITY':

            $lc_align = 'right';

            $lc_text = ' ' . $listing['products_quantity'] . ' ';

            break;

--------------------------------

replace with:

   case 'PRODUCT_LIST_QUANTITY':

           $lc_align = 'right';

        // Mod for Not Showing Quantity with No Stock No CheckOut

       //  $lc_text = ' ' . $listing['products_quantity'] . ' ';

           $lc_text = '  ';

           break;

==========================================================

// End Eric Haskins Mod
Ciauz
Elvino
marulanda
membro Regular
membro Regular
Messaggi: 125
Iscritto il: 29/10/2005, 12:04
Contatta:

Messaggio da marulanda »

e le righe prima?
Quelle servono e come :lol: !!!
Avatar utente
Spiderweb
membro Veteran
membro Veteran
Messaggi: 573
Iscritto il: 28/09/2005, 22:09
Località: Toscana

Messaggio da Spiderweb »

Scusate,
ma per bloccare un ordine se uno dei prodotti selezionati non è disponibile nella quantità scelta non basta settare su FALSE l'opzione ALLOW CHECKOUT in Admin - Configurazione - Stock?
Io ho fatto così e sembra che funzioni...
Ciao!
Rispondi