Jump to content

samuel89

Members
  • Posts

    95
  • Joined

  • Last visited

Profile Information

  • Activity
    Prospect

Recent Profile Visitors

2,997,237 profile views

samuel89's Achievements

Newbie

Newbie (1/14)

7

Reputation

  1. Im using prestashop 1.6..it's a little buggy, takes some time to fix it, but it's better than any third party solution..
  2. Is there a way to do it throught code? any function like setProductShopActive? Thanks.
  3. I believe these are the stuff you are looking for. You just need to adjusts those functions in AdminStatsController.
  4. Hi, I wanna create new table with primary id as stock transfer id. Can anyone point to me which file or function that prestashop use to create unique supplyorder ID. is it this part in classes/stock/SupplyOrder.php? public static $definition = array( 'table' => 'supply_order', 'primary' => 'id_supply_order', 'fields' => array( 'id_supplier' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'supplier_name' => array('type' => self::TYPE_STRING, 'validate' => 'isCatalogName', 'required' => false), 'id_lang' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'id_warehouse' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'id_supply_order_state' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'id_currency' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'id_ref_currency' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'reference' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true), 'date_delivery_expected' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'required' => true), 'total_te' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice'), 'total_with_discount_te' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice'), 'total_ti' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice'), 'total_tax' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice'), 'discount_rate' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat', 'required' => false), 'discount_value_te' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice'), 'is_template' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'), 'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'), ), ); then it will auto create unique supply order id when new Supplyorder got added ?
  5. In case anyone needs it, it is strval(preg_replace('/\.{2,}/', '.', Tools::getValue('csv'))) Use it within AdminImportController.
  6. Hi, is it possible to obtain the filename of the file being imported somewhere in AdminImportController? Thanks, Samuel
  7. bumped! did you manage to find it? I think this will help https://addons.prestashop.com/en/payment-invoice/6946-invoice-payment.html
  8. Hi, I have the following code to override statsbestmanufacturers.php. But it retail_sales cannot be located. I think it's because of $this-> (objects) but I do not know how to fix. Can someone help? Thanks Samuel <?php //fix statsbestsuppliers. Addon Retail and Actual sales //function getData() cant't override. Need to modify actual module file. class StatsBestManufacturersOverride extends StatsBestManufacturers { public function __construct() { $this->name = 'statsbestmanufacturers'; $this->tab = 'analytics_stats'; $this->version = '1.5.1'; $this->author = 'PrestaShop'; $this->need_instance = 0; parent::__construct(); $this->default_sort_column = 'sales'; $this->default_sort_direction = 'DESC'; $this->empty_message = $this->l('Empty recordset returned.'); $this->paging_message = sprintf($this->l('Displaying %1$s of %2$s'), '{0} - {1}', '{2}'); $this->columns = array( array( 'id' => 'name', 'header' => $this->l('Name'), 'dataIndex' => 'name', 'align' => 'center' ), array( 'id' => 'quantity', 'header' => $this->l('Quantity sold'), 'dataIndex' => 'quantity', 'align' => 'center' ), array( 'id' => 'retail_sales', 'header' => $this->l('Total Retail Sales'), 'dataIndex' => 'retail_sales', 'align' => 'center' ), array( 'id' => 'sales', 'header' => $this->l('Total Actual Sales'), 'dataIndex' => 'sales', 'align' => 'center' ) ); $this->displayName = $this->l('Best manufacturers'); $this->description = $this->l('Adds a list of the best manufacturers to the Stats dashboard.'); $this->ps_versions_compliancy = array('min' => '1.6', 'max' => '1.7.0.99'); } public function hookAdminStatsModules($params) { $engine_params = array( 'id' => 'id_category', 'title' => $this->displayName, 'columns' => $this->columns, 'defaultSortColumn' => $this->default_sort_column, 'defaultSortDirection' => $this->default_sort_direction, 'emptyMessage' => $this->empty_message, 'pagingMessage' => $this->paging_message ); if (Tools::getValue('export')) $this->csvExport($engine_params); $this->html = ' <fieldset> <legend><img alt="'.$this->name.'" src="../modules/'.$this->name.'/logo.gif" /> '.$this->displayName.'</legend> '.$this->engine($engine_params).'<br /> <a href="'.Tools::safeOutput($_SERVER['REQUEST_URI'].'&export=1').'"><img alt="asterisk" src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a> </fieldset> '; return $this->html; } public function getData() { $this->_totalCount = $this->getTotalCount(); //$this->query = 'SELECT m.name, SUM(od.product_quantity) as quantity, ROUND(SUM(od.product_quantity * od.product_price) / c.conversion_rate, 2) as sales $this->query = 'SELECT m.name, SUM(od.product_quantity) as quantity, ROUND(SUM(od.product_quantity * od.product_price) / o.conversion_rate, 2) as retail_sales, ROUND(SUM(od.product_quantity * od.unit_price_tax_excl) / o.conversion_rate, 2) as sales FROM '._DB_PREFIX_.'order_detail od LEFT JOIN '._DB_PREFIX_.'product p ON (p.id_product = od.product_id) LEFT JOIN '._DB_PREFIX_.'orders o ON (o.id_order = od.id_order) LEFT JOIN '._DB_PREFIX_.'currency c ON (c.id_currency = o.id_currency) LEFT JOIN '._DB_PREFIX_.'manufacturer m ON (m.id_manufacturer = p.id_manufacturer) WHERE o.invoice_date BETWEEN '.$this->getDate().' '.Shop::addSqlRestriction(Shop::SHARE_ORDER, 'o').' AND o.valid = 1 AND m.id_manufacturer IS NOT NULL GROUP BY p.id_manufacturer'; if (Validate::IsName($this->_sort)) { $this->query .= ' ORDER BY `'.bqSQL($this->_sort).'`'; if (isset($this->_direction) && Validate::isSortDirection($this->_direction)) $this->query .= ' '.$this->_direction; } if (($this->_start === 0 || Validate::IsUnsignedInt($this->_start)) && Validate::IsUnsignedInt($this->_limit)) $this->query .= ' LIMIT '.(int)$this->_start.', '.(int)$this->_limit; $this->_values = Db::getInstance()->executeS($this->query); } }
  9. Hi Quang, Yes, but how do i prevent it from creating 3 different warehouse id in the first place? the SKUs that I checkout all have quantities in the warehouse i tried to use , eg WH1. And when I checkout, all quantities was taken from WH1 too. But somehow it split into 3 packages. Thanks, Samuel
  10. Hi, I am trying to have separate warehouses and make orders ship from only 1 warehouse for orders made for that warehouse (consignment stores) So, I created a separate zone, state, carrier and uses the special carrier for that particular warehouse. So far so good. However, When I tried to create the order, it split the order into 3 orders. Attached is the output from function getPackageList $final_package_list. Can anyone help to find out why it got split into 3 packages? Thanks, Samuel myfile.txt
  11. They removed ASM in prestashop 1.7. You need to use their official ERP module. https://addons.prestashop.com/en/modules-prestashop/39407-prestashop-erp-suite.html
  12. For those having same issue for PS1.5, i realize removing merchant expertise from AdminHeader helps. Cheers and happy selling!
×
×
  • Create New...