Got it working and picking product by its manufacturer and model.
So the last question I have is how can I define that if manufacturers_id=17 it also is "EXM"
Here's working extra cart action, if anybody would need it
Code:<?php /** * Custom shopping Cart actions * * @package initSystem * @copyright Copyright 2003-2011 Zen Cart Development Team * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 */ if (!defined('IS_ADMIN_FLAG')) { die('Illegal Access'); } /** * check whether an "action" has been set. And if m= & aribrand= is set but no products_id is set, * then lookup products_id from products_model (m) and manufacturers_id (aribrand) */ if (isset($_GET['action']) && $_GET['action']=='buy_now' && isset($_GET['m']) && isset($_GET['aribrand']) && !isset($_GET['products_id'])) { $sql= "select products_id from " . TABLE_PRODUCTS . " where products_model = :themodel: && manufacturers_id = :brand: LIMIT 1"; $sql = $db->bindvars($sql, ':themodel:', $_GET['m'], 'string'); $sql = $db->bindvars($sql, ':brand:', $_GET['aribrand'], 'string'); $lookup = $db->Execute($sql); if ($lookup->RecordCount() == 1) { $_GET['products_id'] = $lookup->fields['products_id']; unset($_GET['aribrand']); unset($_GET['m']); zen_redirect(zen_href_link($goto, zen_get_all_get_params('m'))); zen_redirect(zen_href_link($goto, zen_get_all_get_params('aribrand'))); } } ?>


Reply With Quote

