Jump to content
thirty bees forum

Minik

Members
  • Posts

    16
  • Joined

  • Last visited

Posts posted by Minik

  1. It works now, thank you very much.

    I changed: if (@Mail::Send( (int) $order->id_lang, 'in_transit', Mail::l('Package in transit', (int) $order->id_lang), $templateVars, $customer->email, $customer->firstname.' '.$customer->lastname, null, null, null, null, _PS_MAIL_DIR_, true, (int) $order->id_shop )) { Hook::exec('actionAdminOrdersTrackingNumberUpdate', ['order' => $order, 'customer' => $customer, 'carrier' => $carrier], null, false, true, false, $order->id_shop); Tools::redirectAdmin(static::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=4&token='.$this->token); } else { $this->errors[] = Tools::displayError('An error occurred while sending an email to the customer.'); }

    To

    Hook::exec('actionAdminOrdersTrackingNumberUpdate', ['order' => $order, 'customer' => $customer, 'carrier' => $carrier], null, false, true, false, $order->id_shop); Tools::redirectAdmin(static::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=4&token='.$this->token);

  2. Hello @wakabayashi

    What exactly would you suggest with the "if (1==1) {}" ?

    The code looks like this:

    if (@Mail::Send( (int) $order->id_lang, 'in_transit', Mail::l('Package in transit', (int) $order->id_lang), $templateVars, $customer->email, $customer->firstname.' '.$customer->lastname, null, null, null, null, _PS_MAIL_DIR_, true, (int) $order->id_shop )) {

  3. How do i disable the in_transit email so the customer do not receive the email everytime i insert a trackingnumber for an order?

    The problem was solved by following @wakabayashi 's suggestion by editing AdminOrdersController.php in /public_html/controllers/admin/.

    Change:

    if (@Mail::Send( (int) $order->id_lang, 'in_transit', Mail::l('Package in transit', (int) $order->id_lang), $templateVars, $customer->email, $customer->firstname.' '.$customer->lastname, null, null, null, null, _PS_MAIL_DIR_, true, (int) $order->id_shop )) { Hook::exec('actionAdminOrdersTrackingNumberUpdate', ['order' => $order, 'customer' => $customer, 'carrier' => $carrier], null, false, true, false, $order->id_shop); Tools::redirectAdmin(static::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=4&token='.$this->token); } else { $this->errors[] = Tools::displayError('An error occurred while sending an email to the customer.'); }

    To

    Hook::exec('actionAdminOrdersTrackingNumberUpdate', ['order' => $order, 'customer' => $customer, 'carrier' => $carrier], null, false, true, false, $order->id_shop); Tools::redirectAdmin(static::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=4&token='.$this->token);

  4. Yes dublicates loses the attachments but the main problem is that attachments uploaded in "Catalog - Attachments" can't be chosen afterwards in the products, which is a problem if you would like to use the same attachment for several products.

    The print screen in the top is an example of how it looks when i edit a product and would like to choose an attachment i already have uploaded, then i can't find the attachment.

  5. When i go to backoffice in Thirtybees 1.0.3 and upload an attachment in "Catalog - Attachments", i am not able to find the uploaded attachment when i go to a product and would like to choose the recent uploaded attachment.

    If i dublicate a product with an attachment, the attachment disappears on the new product. If i try to upload the attachment manually in each product, it works fine.

    0_1509091550039_Print screen.png

    Problem solved 02.01.2018 by following @SLiCK_303's suggestion by replacing the code below in "Classes/Attachment.php"

    Replace:

    public static function getAttachments($idLang, $idProduct, $include = true)
    {
        return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(
            (new DbQuery())
                ->select('a.*, al.*')
                ->from('attachment', 'a')
                ->leftJoin('attachment_lang', 'al', 'a.`id_attachment` = al.`id_attachment`')
                ->leftJoin('product_attachment', 'pa', 'pa.`id_attachment` = a.`id_attachment`')
                ->where('al.`id_lang` = '.(int) $idLang)
                ->where($include ? 'pa.`id_product` = '.(int) $idProduct : '')
                ->where('pa.`id_product` IS '.($include ? 'NOT ' : '').'NULL')
        );
    }
    

    with:

    public static function getAttachments($idLang, $idProduct, $include = true)
    {
        return Db::getInstance()->executeS('
            SELECT *
            FROM '._DB_PREFIX_.'attachment a
            LEFT JOIN '._DB_PREFIX_.'attachment_lang al
                ON (a.id_attachment = al.id_attachment AND al.id_lang = '.(int) $idLang.')
            WHERE a.id_attachment '.($include ? 'IN' : 'NOT IN').' (
                SELECT pa.id_attachment
                FROM '._DB_PREFIX_.'product_attachment pa
                WHERE id_product = '.(int) $idProduct.'
            )'
        );
    }
    
  6. I’m having a similar error 500 problem when trying to install thirty bees. When clicking “Next” on the “store information” install page, i receive this error:

    Fatal error: Uncaught Error: Class ‘Validate’ not found in /var/“DOMAINNAME”/install/controllers/http/configure.php:118 Stack trace: #0 /var/www/DOMAINNAME/install/classes/controllerHttp.php(182): InstallControllerHttpConfigure->validate() #1 /var/www/DOMAINNAME/install/trystart.php(34): InstallControllerHttp::execute() #2 /var/www/DOMAINNAME/install/index.php(56): require_once(’/var/www/DOMAINNAME…’) #3 {main} thrown in /var/www/DOMAINNAME/install/controllers/http/configure.php on line 118

    Anyone have a solution for the problem?

  7. I'm having a similar error 500 problem when trying to install thirty bees. When clicking "Next" on the "store information" install page, i receive this error:

    Fatal error: Uncaught Error: Class 'Validate' not found in /var/"DOMAINNAME"/install/controllers/http/configure.php:118 Stack trace: #0 /var/www/DOMAINNAME/install/classes/controllerHttp.php(182): InstallControllerHttpConfigure->validate() #1 /var/www/DOMAINNAME/install/trystart.php(34): InstallControllerHttp::execute() #2 /var/www/DOMAINNAME/install/index.php(56): require_once('/var/www/DOMAINNAME...') #3 {main} thrown in /var/www/DOMAINNAME/install/controllers/http/configure.php on line 118

    Anyone have a solution for the problem?

×
×
  • Create New...