Jump to content

rainbowfication

Members
  • Posts

    6
  • Joined

  • Last visited

Profile Information

  • Activity
    Freelancer

rainbowfication's Achievements

Newbie

Newbie (1/14)

  • Week One Done Rare
  • One Month Later Rare
  • One Year In Rare

Recent Badges

2

Reputation

  1. Hi all, I have two issue when looking/creating at orders in the back-end, looking for solutions or fix's ideally. Order Messages Not all messages show on the order page. When I add a message on the order page there is no log of it, except in the customer service messages area. I aiming to use this just for employee notes, but as it doesn't appear on the order its effectively useless. after looking further customer reply's show up? Customization fields/files When add a product with a customization to a new order or alter one in the back-end, there is no way of inputting that information in the back-end even if required on a product? I have searched for solutions but nothing relating to version 1.6.0.9 Any help much appreciated
  2. Hi all, I have two issue when looking/creating at orders in the back-end, looking for solutions or fix's ideally. Order Messages Not all messages show on the order page. When I add a message on the order page there is no log of it, except in the customer service messages area. I aiming to use this just for employee notes, but as it doesn't appear on the order its effectively useless. after looking further customer reply's show up? Customization fields/files When add a product with a customization to a new order or alter one in the back-end, there is no way of inputting that information in the back-end even if required on a product? I have searched for solutions but nothing relating to version 1.6.0.9 Any help much appreciated
  3. You need to edit ebay.php in the modules folder. Please note updates do wipe this out and always backup: go to around line 2097 and change: $picturesMedium[] = str_replace('https://', 'http://', $prefix . $link->getImageLink('ebay', $product->id . '-' . $image['id_image'], 'medium' . ($this->isVersionOneDotFive('>=', '1.5.1') ? '_default' : ''))); to: $picturesMedium[] = str_replace('https://', 'http://', $prefix . $link->getImageLink('ebay', $product->id . '-' . $image['id_image'], 'large' . ($this->isVersionOneDotFive('>=', '1.5.1') ? '_default' : ''))); need to check if same case with new update will post if has changed
  4. Does the data need to stay in the external database? As its possible just much easier to do if you imported the data to in the same database that prestashop uses?
  5. I have managed to make this work via bypassing the class I was having issues with and directly imputing the data in a new class via tcpdf. That works fine in this situation but could be useful knowing how its possible the other way too still, if anyone's got any knowledge
  6. Hello all, Im trying to create a new dynamic pdf doc, please note this is not a invoice. I have based the code from pdf invoice and order slips and have been able to use a controller and class to generate a template pdf successfully with information in a TPL. Im having issues transferring data from the controller to smarty to use in the template. From testing I think the issue is with the object that is sent across from the initial controller, i dont think it sending any currently but unsure how. Any help will be appreciated showing me what Im doing wrong, even pointing me to some related documentation as i cant find much on how the pdf controller works. I am not looking to buy a module as its not essential, Its more about learning how to do it. Thanks Tom PdfVoucherController: class PdfVoucherControllerCore extends FrontController { protected $display_header = false; protected $display_footer = false; protected $voucher_codes; protected $code2; public function postProcess() { if (!$this->context->customer->isLogged()) Tools::redirect('index.php?controller=authentication&back=order-follow'); if (isset($_GET['id_code']) && Validate::isUnsignedId(Tools::getValue('id_code')) && Tools::getValue('code') == Code::getCodeByID(Tools::getValue('id_code')) ) $this->voucher_codes = new Code(Tools::getValue('id_code')); if (isset($_GET['id_code']) && Validate::isUnsignedId(Tools::getValue('id_code')) && Tools::getValue('code') == Code::getCodeByID(Tools::getValue('id_code')) ) $this->code2 = $_GET['id_code']; if (!isset($this->voucher_codes) || !Validate::isLoadedObject($this->voucher_codes)) die(Tools::displayError('Order return not found.')); } public function display() { $pdf = new PDF($this->voucher_codes, PDF::TEMPLATE_VOUCHER, $this->context->smarty, $this->code2); $pdf->render(); } } Code class Code extends ObjectModel { public $customer; public $code; public $date_from; public $date_to; public $active = true; public static $definition = array( 'table' => 'voucher_codes', 'primary' => 'id_code', 'fields' => array( 'code' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true, 'size' => 64), 'customer' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true, 'size' => 64), 'active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'date_from' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true, 'size' => 64), 'date_to' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true, 'size' => 64), ), ); protected $webserviceParameters = array(); public static function getCodes($active = false) { return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' SELECT * FROM `'._DB_PREFIX_.'voucher_codes` '.($active ? 'WHERE active = 1' : '').' ORDER BY `code` ASC '); } public function getCodesCollection() { $order_codes = new Collection('OrderCodes'); $order_codes->where('id_Code', '=', $this->id); return $order_codes; } public static function getIdByName($name) { return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' SELECT `id_code` FROM `'._DB_PREFIX_.'voucher_codes` WHERE `code` = \''.pSQL($name).'\' '); } public static function getCodeByID($id) { return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' SELECT `code` FROM `'._DB_PREFIX_.'voucher_codes` WHERE `id_code` = \''.pSQL($id).'\' '); } public static function getDateFromByID($id) { return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' SELECT `date_from` FROM `'._DB_PREFIX_.'voucher_codes` WHERE `id_code` = \''.pSQL($id).'\' '); } public static function getDateToByID($id) { return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' SELECT `date_to` FROM `'._DB_PREFIX_.'voucher_codes` WHERE `id_code` = \''.pSQL($id).'\' '); } public static function getCustomerByID($id) { return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' SELECT `customer` FROM `'._DB_PREFIX_.'voucher_codes` WHERE `id_code` = \''.pSQL($id).'\' '); } public function delete() { if (parent::delete()) { } return false; } } HTMLTemplateVoucher class HTMLTemplateVoucherCore extends HTMLTemplate { public $voucher; public $voucher_codes; public function __construct(Code $voucher_codes, $smarty) { $this->voucher_codes = $voucher_codes; $this->voucher = new Code($voucher_codes->id_code); $this->smarty = $smarty; } public function getContent() { $this->smarty->assign(array( 'id_code' => $this->voucher->id_code, 'code' => Code::getCodeByID($this->voucher_codes->id_code), 'date_from' => Code::getDateFromByID($voucher_codes->id_code), 'date_to' => Code::getDateToByID($voucher_codes->id_code) )); return $this->smarty->fetch($this->getTemplate('Voucher')); } public function getFilename() { return sprintf('%06d', $this->voucher).'.pdf'; } public function getBulkFilename() { return 'Vouchers.pdf'; } }
×
×
  • Create New...