Jump to content
thirty bees forum

moy2010

Members
  • Posts

    126
  • Joined

  • Last visited

Posts posted by moy2010

  1. I have never done an SQL join using prestashop helpers, but it might work like this:

      $this->_select = 'st.`name` as state';
        $this->_join = '
            LEFT JOIN `'._DB_PREFIX_.'state` st ON (st.`id_state` = a.`id_state`)
            LEFT JOIN `'._DB_PREFIX_.'customer` c ON a.id_customer = c.id_customer
        ';
        $this->_where = 'AND a.id_customer != 0 '.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER, 'c');
        $this->_use_found_rows = false;
    
  2. The fields list is in controllers/admin/AdminAddressesController.php

        $this->fields_list = array(
            'id_address' => array('title' => $this->l('ID'), 'align' => 'center', 'class' => 'fixed-width-xs'),
            'firstname' => array('title' => $this->l('First Name'), 'filter_key' => 'a!firstname'),
            'lastname' => array('title' => $this->l('Last Name'), 'filter_key' => 'a!lastname'),
            'address1' => array('title' => $this->l('Address')),
            'postcode' => array('title' => $this->l('Zip/Postal Code'), 'align' => 'right'),
            'city' => array('title' => $this->l('City')),
            'country' => array('title' => $this->l('Country'), 'type' => 'select', 'list' => $this->countries_array, 'filter_key' => 'cl!id_country'));
    

    You can modify it to include the state, I guess.

  3. I want to check the product visibility in the product template (product.tpl). In product class there's the variable $visibility which stores a string:

    /** @var string ENUM('both', 'catalog', 'search', 'none') front office visibility */
    public $visibility;
    

    And I've tried to access that variable directly fron product.tpl with no success. Is there a way to check if a class variable is passed to the controller? Or what do I need to do to have that variable available in the smarty template?

    Thanks in advance.

×
×
  • Create New...