<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[problema funzione oscommerce]]></title><description><![CDATA[<p dir="auto">Salve a tutti, ho un problema nel mio shop oscommerce, ho istallato una contribution che permette di impostare da lato admin il numero massimo di un prodotto inserito nel carrello (se ho 2 maglie non ti fa comprare 3 uguali riportando il carrello in automatico a 2)<br />
il problema sta che se voglio comprare lo stesso articolo sia bianco che nero, dopo aver aggiornato il carrello la seconda maglia sparice.<br />
Il tutto deriva da questo pezzo di codice:</p>
<pre><code class="language-html">//MAXIMUM quantity code
if(MAXIMUM_ORDERS == 'true'){
   $max_order_query = tep_db_query("select p.maxorder as max_quant FROM " . TABLE_PRODUCTS . " p where p.products_id = '".$products[$i]['id']."'");
   while ($max_order = tep_db_fetch_array($max_order_query))  {
      $products[$i]['max_quant']=$max_order['max_quant']; // set the cart item max var
      if (!empty($products[$i]['max_quant'])) {//add check account for if max_quant is null or '', if it is you can skip all this stuff can it's umlimited
       // okay if this product already is in basket irregardless of it's attributes selected... keep the old one
      for ($ic = 0; $ic &lt; $i;$ic++) {
         if (tep_get_prid($products[$i]['id']) == tep_get_prid($products[$ic]['id'])) {
         $cart_notice .= sprintf(MAXIMUM_ORDER_DUPLICATE, $products[$i]["name"], $products[$i]["max_quant"]) . '&lt;br /&gt;'; // notify them they can not do that
          $cart_skip_prod = true;
         $cart-&gt;remove($products[$i]['id']); // remove this new item from the cart session
         $cart_skip_prod = true; // set a flag so we can bypass output of the item that was already stuck into the products array before we removed it just now
         }
         else {
         //$cart_notice .= ' - okay no match ';
         }
         $cart_notice .= '&lt;br /&gt;';
      }

      // okay now for products that have no attributes or have identical attributes
      if ($products[$i]['quantity'] &gt; $max_order['max_quant'] ) { //add check account for if max_quant is null or '', if so let it go through.
         $products[$i]['quantity']=$products[$i]['max_quant'];
         $cart-&gt;add_cart($products[$i]['id'],$products[$i]['quantity'],$products[$i]['attributes']); // update the qty
         $cart_notice .= sprintf(MAXIMUM_ORDER_NOTICE, $products[$i]["name"], $products[$i]["max_quant"]); // notify them they can not do that
      }
      }
   }
}

if ($cart_skip_prod) { // still need to skip displaying the item still stuck in $products array even though we removed it from $cart
   break;
   }
//End MAXIMUM quantity code
</code></pre>
<p dir="auto">quancuno sa il punto esatto del problema?<br />
ho notato anche che lasciando cosi,nel carrello di lato al prodotto appare il colore scelto solo della prima inserita mentr per la seconda appare un -.<br />
Mettendo false dove dice "cart_skip_prod" la seconda taglia viene memorizzata, ma facendo aggiorna sparice il prodotto dal carrello.</p>
]]></description><link>https://dev.connect.gt/topic/131845/problema-funzione-oscommerce</link><generator>RSS for Node</generator><lastBuildDate>Thu, 26 Nov 2026 22:41:52 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/131845.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 22 Jul 2010 07:14:17 GMT</pubDate><ttl>60</ttl></channel></rss>