News:

Looking for documentation? Take a look on our wiki

Main Menu

Vendor problems (and proposed solution)

Started by doorknob, August 12, 2008, 02:25:31 AM

Previous topic - Next topic

doorknob

I have some problems with Vendors.

1. I created a number of Vendors and then added a new product. The Vendor drop down list is created in the product form and shows the list of available vendors but does not show the 'default' vendor. That means that the user is forced to select one of the vendors without the chance to say 'none of the above'.
2. Defaulting the vendor selection to anything other than 'default' is dangerous and will inevitably lead to usage problems. I will create a dummy vendor with a name that forces it to be the first alphabetically to avoid accidents but this is not a satisfactory long term solution.
3. The manual indicates (p94 of the Aug08 version) that the default vendor can be configured at 'Store | Edit Store'. I can't see any reference on that page.

Regards
Phil
(J1.5.3; vm 1.1.2 (nightly 9th Aug))

aravot

Vendor is not implemented fully, we are discussing as how it should be and might have it ready for v1.2 once we agree on a direction.

Milbo has submitted a code to be committed we are review the code.
http://forum.virtuemart.net/index.php?topic=43687.0

doorknob

Peter,
I now have a fix for the vendor problem when adding a new product. This sets a default value of 1 when a new product is added.
In html/product.product_form.php:
Add the following line of code around line 152:
$vendor_id = is_null($db->sf("vendor_id")) ? 1 : $db->sf("vendor_id"); //vendor_id  defaults to 1

Change line 159 from
$q =  "SELECT shopper_group_id,shopper_group_name FROM #__{vm}_shopper_group WHERE `default`= '1' AND vendor_id='".$db->f("vendor_id")."'";

to
$q =  "SELECT shopper_group_id,shopper_group_name FROM #__{vm}_shopper_group WHERE `default`= '1' AND vendor_id='".$vendor_id."'";


and change line 244 from
      <td width="79%" ><?php ps_vendor::list_vendor($db->sf("vendor_id"));  ?></td>

to
      <td width="79%" ><?php ps_vendor::list_vendor($vendor_id); ?></td>


Regards
Phil