VirtueMart 1.1.x [ Old version - no longer supported ] > Administration & Configuration VM 1.1

delete control over product_sku

(1/1)

Pacther:
Hello everyone, I'm new to the forum, surely I will be very good.  ;D

I have a problem to be solved .. I would like to delete the control on the product_sku in order to have multiple products with the same product code.
I think that the code within the file ps_product (/administrator/components/com_virtuemart/classes) line 29. I made ​​changes but without significant results.  >:(

/**
    * Validates product fields and uploaded image files.
    *
    * @param array $d The input vars
    * @return boolean True when validation successful, false when not
    */
   function validate(&$d) {
      global $vmLogger, $database, $perm, $VM_LANG;
      require_once(CLASSPATH . 'imageTools.class.php' );
      
      $valid = true;
      $db = new ps_DB;

      $q = "SELECT product_id,product_thumb_image,product_full_image FROM #__{vm}_product WHERE product_sku='";
      $q .= $d["product_sku"] . "'";
      $db->setQuery($q); $db->query();
      if ($db->next_record()&&($db->f("product_id") != $d["product_id"])) {
         $vmLogger->err( "A Product with the SKU ".$d['product_sku']." already exists." );
         $valid = false;
      }

Can anyone help me?  :D

thanks

Pacther:
hello .. I deleted the line 44 $db->setQuery($q); $db->query(); and now I can create more products with the same code.
But there is another problem.
During the search of products in my front-end results in only the last inserted.
As if I perform research in the admin panel I can have as a result of the 2 products.
It 'may be a limitation of the research?
thanks again

Navigation

[0] Message Index

Go to full version