Jump to content
thirty bees forum

Rhapsody

Trusted Members
  • Posts

    98
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by Rhapsody

  1. @Yabber That didn't work for me.  I cam up with a work around so there is a note on the order confirmation email with a link to the order history so they may download the PDF that is properly set with the new member number. Existing members on renewal can use the PDF invoice attached to the email.  

    I consider this solved and thank all for the help. I used the custom module approach.

  2. Thinking about this... might it be possible that the new hook I created is getting called after the order confirmation email that generates & attaches the pdf?  That means the member field in the ps_customer table has not been updated so when the $customer object is passed, the member number is still blank.  If so, how do I prioritize the new hook to have a higher priority and perform the action first?

  3. @yaniv14 I use the built in templates modified, and it works for orders where the member number was previously assigned..  In my themes/pdf folder I have added fields to display:

     Membership # {$customer->member} <br>

    I have an override placed in \shop\override\classes\pdf\HTMLTemplateInvoice.php that gets the customer table fields (including member) with the following code:

    <?php
    /**
     * HTMLTemplateInvoice.php
     *
     * Override for 30 Bees 1.6.0 HTMLTemplateInvoice.php to get order messages so they can be displayed in pdf invoice
     * Adds custom variables for membership card based on Commodore assigned in Customer table (Crew Manager Commented Out)
     * Adds scratch sheet information variables (Crew Manager Commented Out)
     * Adds address fields to format pdf
     * Adds custom variables in ps_configuration table
     * PS_COMMODORE = 'commodore', PS_ASSOCIATE_MEMBER_VOUCHER = 'associate_member_voucher'
     * PS_REGULAR_MEMBER_VOUCHER = regular_member_voucher'
     * PS_VOUCHER_TEXT = 'voucher_text'
     * PS_VOUCHER_ENABLE = 'voucher_enable'
     *
     */
    
    class HTMLTemplateInvoice extends HTMLTemplateInvoiceCore
    {
        /**
         * Returns the template's HTML content
         *
         * @return string HTML content
         *
         * @throws PrestaShopDatabaseException
         * @throws PrestaShopException
         * @throws SmartyException
         */
        public function getContent()
        {
    /****************  CHNYC adds **********************/
    		$country = new Country((int)$this->order->id_address_invoice);
    		$invoice_address = new Address((int)$this->order->id_address_invoice);
    		$formatted_invoice_address = AddressFormat::generateAddress($invoice_address, array(), '<br />', ' ');
    		$formatted_delivery_address = '';
    
    		if ($this->order->id_address_delivery != $this->order->id_address_invoice)
    		{
    			$delivery_address = new Address((int)$this->order->id_address_delivery);
    			$formatted_delivery_address = AddressFormat::generateAddress($delivery_address, array(), '<br />', ' ');
    		}
    
    		$customer = new Customer((int)$this->order->id_customer);
    /*******************  CHNYC Adds above  *********************************/
    
    
    /************** Get Address fields for PDF  ***************************/
    
            $invoice = new Address((int) $this->order->id_address_invoice);
            $delivery = new Address((int) $this->order->id_address_delivery);
            $delivery_state_iso = $delivery->id_state ? new State((int)$delivery->id_state) : false;
            $invoice_state_iso = $invoice->id_state ? new State((int)$invoice->id_state) : false;
            $delivery_state = $delivery->id_state ? new State((int)$delivery->id_state) : false;
            $invoice_state = $invoice->id_state ? new State((int)$invoice->id_state) : false;
    
            $sqlDelivery = "SELECT a.`company`, a.`other` FROM `" ._DB_PREFIX_. "address` a
                WHERE a.id_address = " .(int)$this->order->id_address_delivery;
    
            $delivery_fields = Db::getInstance()->getRow($sqlDelivery); // delivery address fields
    
            $sqlInvoice = "SELECT a.`company`, a.`other` FROM `" ._DB_PREFIX_. "address` a
                WHERE a.id_address = " .(int)$this->order->id_address_invoice;
    
            $invoice_fields = Db::getInstance()->getRow($sqlInvoice); // invoice address fields
    //        var_dump($delivery_fields);
    
    /************** End Get Address fields for PDF  *********************/
    
            $orderDetails = $this->order_invoice->getProducts();
    
            $hasDiscount = false;
            foreach ($orderDetails as $id => &$orderDetail) {
                // Find out if column 'price before discount' is required
                if ($orderDetail['reduction_amount_tax_excl'] > 0) {
                    $hasDiscount = true;
                    $orderDetail['unit_price_tax_excl_before_specific_price'] = $orderDetail['unit_price_tax_excl_including_ecotax'] + $orderDetail['reduction_amount_tax_excl'];
                } elseif ($orderDetail['reduction_percent'] > 0) {
                    $hasDiscount = true;
                    $orderDetail['unit_price_tax_excl_before_specific_price'] = (100 * $orderDetail['unit_price_tax_excl_including_ecotax']) / (100 - $orderDetail['reduction_percent']);
                }
    
    		}
    
             $this->smarty->assign(array(
    
    /**** CHNYC extra fields ********/
    			'voucher_text' => Configuration::get('PS_VOUCHER_TEXT'),
    			'commodore' => Configuration::get('PS_COMMODORE'),
    			'associate_member_voucher' => Configuration::get('PS_ASSOCIATE_MEMBER_VOUCHER'),
    			'regular_member_voucher' => Configuration::get('PS_REGULAR_MEMBER_VOUCHER'),		
    			'voucher_enable' => Configuration::get('PS_VOUCHER_ENABLE'),
    			'customer' => $customer,
    /****** end CHNYC Extra Fields *****/
    			'order' => $this->order,
    			'order_details' => $this->order_invoice->getProducts(),
    			'delivery_company' 			 => $delivery_fields['company'],
    			'delivery_firstname'		 => $delivery->firstname,
    			'delivery_lastname'			 => $delivery->lastname,
    			'delivery_address1'			 => $delivery->address1,
    			'delivery_address2'			 => $delivery->address2,
    			'delivery_city'				 => $delivery->city,
    			'delivery_postal_code'		 => $delivery->postcode,
    			'delivery_country'			 => $delivery->country,
    			'delivery_state_iso'		 => $delivery->id_state ? $delivery_state->iso_code : '',
    			'delivery_state'			 => $delivery->id_state ? $delivery_state->name : '',
    			'delivery_phone'			 => $delivery->phone,
    			'delivery_phone_mobile'		 => $delivery->phone_mobile,
    			'delivery_other'			 => $delivery_fields['other'],
    			'invoice_company'			 => $invoice_fields['company'],
    			'invoice_firstname'			 => $invoice->firstname,
    
    			'invoice_lastname'			 => $invoice->lastname,
    			'invoice_address2'			 => $invoice->address2,
    			'invoice_address1'			 => $invoice->address1,
    			'invoice_city'				 => $invoice->city,
    			'invoice_postal_code'		 => $invoice->postcode,
    			'invoice_country'			 => $invoice->country,
    			'invoice_state_iso'				 => $invoice->id_state ? $invoice_state->iso_code : '',
    			'invoice_state'				 => $invoice->id_state ? $invoice_state->name : '',
    			'invoice_phone'				 => $invoice->phone,
    			'invoice_phone_mobile'		 => $invoice->phone_mobile,
    			'invoice_other'				 => $invoice_fields['other'],
    
                'messages' =>  CustomerMessage::getMessagesByOrderId((int)($this->order->id), false),
    
             ));
    
                return parent::getContent();
    
       }
    
    }
    
    
    

     

  4. 7 hours ago, yaniv14 said:

    I would probably create a small module instead of doing overrides.

    If I understand your question than you only need to modify DB table of customer with extra data that later order confirmation email with pdf will do the job based on that value.

    If thats the case I will create a module with a single hook of `hookActionValidateOrder` which provide in the $params argument everything you need to run your logic.

    $params will include: order, cart, customer, currency and orderStatus.

    of course you need to place it first in the modules -> positions -> actionValidateOrder.

    all payment module on success payment calls `PaymentModule::validateOrder()` which trigger modules `hookActionValidateOrder` before the order_conf email is sent.

    @yaniv14 - Thanks for the suggestion.  I used your advice and created a module.  It works (kind of).  I pasted the code below.  The member number is created and saved in the ps_customer table member field.  What isn't working is when the pdf invoice is emailed with the order confirmation, the new member number when it is assigned on that order isn't passed.  If it is a membership renewal (e.g. member number already exists) the member number is passed and the pdf is correct.  If I go to the Order History & Details and open the PDF, the newly assigned member number is there.

    Any ideas on what I'm missing?

     

    <?php
    // memberautonumber.php auto assigns member numbers when new membership purchased
    class MemberAutoNumber extends Module
    {
        public function __construct()
        {
            $this->name = 'memberautonumber';
            $this->tab = 'administration'; // Optional: Tab for the module in the back office
            $this->version = '1.0.0';
            $this->author = 'Bill Kneller';
    
            parent::__construct();
    
            $this->displayName = $this->l('Member Auto Number'); // Display name in back office
            $this->description = $this->l('CHNYC Member numbers are automatically assigned when new membership is purchased'); // Description in back office
        }
    
        public function install()
        {
            // Installation logic (e.g., database creation, configuration)
            return parent::install() &&
                   $this->registerHook('hookActionValidateOrder') && $this->registerHook('actionValidateOrder'); // Register a hook
        }
    
        public function uninstall()
        {
            // Uninstallation logic (e.g., database deletion, configuration removal)
            return parent::uninstall() &&
                   $this->unregisterHook('hookActionValidateOrder') && $this->unregisterHook('actionValidateOrder'); // Unregister the hook
        }
    
        public function hookActionValidateOrder($params)
        {
            // Getting differents vars
            // $params will include: order, cart, customer, currency and orderStatus.
            $context = Context::getContext();
            $idLang = (int) $context->language->id;
            $idShop = (int) $context->shop->id;
            $currency = $params['currency'];
            $order = $params['order'];
            $customer = $params['customer'];
            $cart = $params['cart'];
            $orderState = $params['orderStatus'];
    
    	            $id_customer = (int)$this->context->cookie->id_customer;
    	            $customer = new Customer($id_customer);
    				$member = $customer->member;
    				$products = $order->getProducts();
                	//loop and check product reference for membership
    				if (empty($member)) foreach ($products as $key => $product) {
    					$condition = null;
    					if (str_contains($product['product_name'] , 'CHNYC Annual Membership')) $condition = "WHERE member BETWEEN '1' AND '4999'";
    					if (str_contains($product['product_name'] , 'CHNYC Associate Membership')) $condition = "WHERE member BETWEEN '5000' AND '7999'";
    					if (!empty($condition)) {
    						$sql = 'SELECT MAX(member) from ps_customer ' . $condition;
    						$member = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql); //last used member number
    						$member = $member[0]["MAX(member)"];
    						++$member; // this is the next member number
    						$sql = "UPDATE ps_customer SET member = '$member'  WHERE id_customer = '$id_customer' ";
    						$status = Db::getInstance(_PS_USE_SQL_SLAVE_)->execute($sql); //updates member number
    					} // if (!empty($condition))
    				} // if (empty($member)) foreach ($products as $key => $product)
            return; 
        }
    }

     

  5. Objective:  Hook and perform an action when a valid order is place with payment.  This should be done before any emails are sent.

    I have a Thirty Bees shop that started as Prestashop in 2012, migrated to Thirty Bees (now using version 1.6.0) and has been used successfully for our club.  It includes modifications and custom fields that are stored in the ps_customer table. I use overrides and custom templates so that membership cards with a unique membership number are included in the pdf invoice generated. This pdf is sent with the order email.  For existing members, this works great.  For new members I need to manually assign the proper member number, then send an email with the paid invoice.  I would like to automate the member number assignment before the order confirmation email is sent so it picks up the member number for the email.

    I'm thinking that an override to OrderConfirmationController.php in public function displayPaymentReturn() is the best place to do this.  Is that correct or is there a better place?

    Proposed Approach: Below outlines the action to be performed

    • Detect when a paid order is placed and get the id_customer as $id_customer
    • If custom field 'member' in ps_customer table is not empty, exit and continue the normal process
    • If the order does not include the product reference "MemberDues" or "AssocMembr", exit and continue the normal process
    • If the order includes the product reference "MemberDues", $sql = 'SELECT MAX(member) from ps_customer WHERE member BETWEEN '1' AND '4999'" 
    • If the order includes the product reference "AssocMembr", $sql = 'SELECT MAX(member) from ps_customer WHERE member BETWEEN '5000' AND '7999' "; 
    • execute the sql query to obtain the largest member number, and add 1 to the result for the next member number to assign as $new_number
    • execute a sql query to update the member number for the customer, $sql = "UPDATE ps_customer SET member = '$new_number'  WHERE id_customer = '$id_customer' ";
    • continue the normal process

    Please comment if there is a better way to accomplish this before I march off and do the code.

  6. The following are captured in the error log so they may be investigated for future updates:

    Two Smarty errors:

    PHP Deprecated:  Using php-function "stripos" as a modifier is deprecated and will be removed in a future release. Use Smarty::registerPlugin to explicitly register a custom modifier. in .../shop/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_modifier.php on line 112
    PHP Deprecated:  Using php-function "strstr" as a modifier is deprecated and will be removed in a future release. Use Smarty::registerPlugin to explicitly register a custom modifier. in .../shop/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_modifier.php on line 112

    TCPDF errors:

    PHP Warning:  Undefined array key "thead" in .../shop/vendor/tecnickcom/tcpdf/tcpdf.php on line 16679
    PHP Warning:  Undefined array key "trids" in .../shop/vendor/tecnickcom/tcpdf/tcpdf.php on line 19746
    PHP Warning:  foreach() argument must be of type array|object, null given in .../shop/vendor/tecnickcom/tcpdf/tcpdf.php on line 19746
    PHP Warning:  Undefined array key "trids" in .../shop/vendor/tecnickcom/tcpdf/tcpdf.php on line 19778
    PHP Warning:  foreach() argument must be of type array|object, null given in .../shop/vendor/tecnickcom/tcpdf/tcpdf.php on line 19778
  7. Make sure that the necessary PHP installed modules (not the TB modules) are activated on your cPanel.  One easy check is to open two tabs of the cPanel PHP version selector.  Use the older version of PHP in one tab, and the newer version of PHP in the other tab.  Then go through and make sure the same modules are activated in the newer version as the older version.  This approach definitely helped resolve 500 errors when I transitioned to newer versions of PHP.

    • Thanks 1
  8. 8 minutes ago, the.rampage.rado said:

    Do you like the facelift of BO that came with this change?

    I'm getting used to it but am generally resistant to change - just a stubborn old guy....

    I have customized to BO templates for Customers, Addresses, Carts - do I need to verify that these are not impacted?

    The Icons in the top menu bar should have mouse over titles added to make them easier to identify the functions they perform, similar to those on the right side of the top bar.

  9. I just did a Bleeding Edge update on 28 Oct 2024 and note there is now a "Need Help ..., Premium Modules ...., Love Thirty Bees ...."  message in the top bar  and bottom right of the BO screen.  These are annoying!  Additionally clicking the "x" to close them pops up another window "ThirtyBees - Empowering your business to reach new heights!", rather than closing the item.

    Can this be fixed to close them properly, and a way to disable them altogether be provided?

  10. I am receiving errors when saving product descriptions and short product descriptions that contain links that have the javascript onclick function per below.

    This code results in the errors

    ×2 errors

    1. The description field (English (English)) is invalid.
    2. The description_short field (English (English)) is invalid.
    <a title="Subdomain Availability Check" dir="ltr" onclick="window.open('https://crew-mgr.com/website-check/','Subdomain Check','width=600,height=750,left=500,top=50');return false;" href="https://crew-mgr.com/shop/home/1-new-website-with-2-month-subscription.html" target="_self"><span style="color: #3d00ff;">Check Subdomain Availability</span></a>

    I know that when editing the product and saving it, there is a validation that takes place, and the onclick is probably causing the validation to fail. What I don't know is which files are used to conduct the validation. I have worked around this by manually saving the raw html in the database with phpMyAdmin.

    Can anyone provide assistance on which file is used to conduct the validation for saving a product so I can override it to validate the code with the onclick?

  11. On 6/5/2023 at 5:41 AM, 30knees said:

    explode(): Passing null to parameter #2 ($string) of type string is deprecated    modules/genzo_turnstile/genzo_turnstile.php:227 

    @wakabayashi - similar to 30knees I am seeing the same error log entries. It appears to be generated both when logging in and logging out.  I have toggled all the configuration settings and saved them to see if that helps.  It still creates the error log.  Any ideas?

  12. 2 hours ago, wakabayashi said:

    Then I would bet, that your htaccess or nginx configuration is wrong. As the product images changed the url path. I made this to have a clean structure in urls. My nginx looks like this:

    ......

     

    I'm on a shared hosting account on Apache.  This is one of two shops I've tried bleeding edge on that breaks the product images.  before and after update to bleeding edge pasted below.

    .htaccess excerpt TB version 1.5.1

    # Domain: chnyc.us
    RewriteRule . - [E=REWRITEBASE:/shop/]
    
    # Webservice API
    RewriteRule ^api$ api/ [L]
    RewriteRule ^api/(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]
    
    # Images
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3$4.jpg [L]
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.webp$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3$4.webp [L]
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4$5.jpg [L]
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.webp$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4$5.webp [L]
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5$6.jpg [L]
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.webp$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5$6.webp [L]
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6$7.jpg [L]
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.webp$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6$7.webp [L]
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7$8.jpg [L]
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.webp$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7$8.webp [L]
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8$9.jpg [L]
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.webp$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8$9.webp [L]
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9$10.jpg [L]
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.webp$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9$10.webp [L]
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10$11.jpg [L]
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.webp$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10$11.webp [L]
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9\s-]*)(-[0-9]+)?/.+?([2-4]x)?\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3$4.jpg [L]
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9\s-]*)(-[0-9]+)?/.+?([2-4]x)?\.webp$ %{ENV:REWRITEBASE}img/c/$1$2$3$4.webp [L]
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^c/([a-zA-Z\s_-]+)(-[0-9]+)?/.+?([2-4]x)?\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L]
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^c/([a-zA-Z\s_-]+)(-[0-9]+)?/.+?([2-4]x)?\.webp$ %{ENV:REWRITEBASE}img/c/$1$2$3.webp [L]

    .htaccess excerpt TB Bleeding Edge

    # Domain: chnyc.us
    RewriteRule . - [E=REWRITEBASE:/shop/]
    
    # Webservice API
    RewriteRule ^api$ api/ [L]
    RewriteRule ^api/(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]
    
    # Images
    
    # categories images
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^categories/([0-9]+)(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}img/c/$1$2$3.$4 [L]
    
    # categoriesthumb images
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^categoriesthumb/([0-9]+)(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}img/c/thumb/$1$2$3.$4 [L]
    
    # manufacturers images
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^manufacturers/([0-9]+)(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}img/m/$1$2$3.$4 [L]
    
    # products images
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^products/([0-9])(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}/$1/$1$2$3.$4 [L]
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^products/([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}/$1/$2/$1$2$3$4.$5 [L]
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^products/([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}/$1/$2/$3/$1$2$3$4$5.$6 [L]
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^products/([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}/$1/$2/$3/$4/$1$2$3$4$5$6.$7 [L]
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^products/([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.$8 [L]
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^products/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.$9 [L]
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^products/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.$10 [L]
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^products/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.$11 [L]
    
    # scenes images
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^scenes/([0-9]+)(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}img/scenes/$1$2$3.$4 [L]
    
    # scenesthumb images
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^scenesthumb/([0-9]+)(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}img/scenes/thumbs/$1$2$3.$4 [L]
    
    # stores images
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^stores/([0-9]+)(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}img/st/$1$2$3.$4 [L]
    
    # suppliers images
    RewriteCond %{HTTP_HOST} ^chnyc.us$
    RewriteRule ^suppliers/([0-9]+)(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}img/su/$1$2$3.$4 [L]

     

  13. 24 minutes ago, the.rampage.rado said:

    Sorry for the late response. The original file is kept without additional attributes:
    image.png.e2a2c5098928a57ee955d9697f028de9.png

    Check which pic ID error out and download and check their files. There was before similar issue here after the image rewrite and in this case the source images were somehow corrupted on the server.

    If this is not the case I'm afraid you will have to wait for datakick for advise. 😕

    Sorry for my confusing question.  I meant to ask which files in the Thirty Bees bleeding edge code are used to generate the images.  I can do some checking there to help localize the issue.  I do have all the original image files appearing in the directories with the generated images. It is only the product images the bleeding edge has problems with.  Images for categories are generated properly.

  14. Follow up to the post above on .htaccess....

    I have manually regenerated the .htacess file so the proper RewriteRules are in place. Same problem.  The product thumbnails generate fine with stable release, but the product images are not found when generating on bleeding edge.

    Version 1.5.1:

    RewriteRule ^([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3$4.jpg [L]

    Bleeding Edge: 

    RewriteRule ^products/([0-9])(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}/$1/$1$2$3.$4 [L]
  15. 9 hours ago, the.rampage.rado said:

    Yes, the url is different now. Can you check if your active htaccess file contains (when on edge of course) contains lines as:

    RewriteRule ^products/([0-9])(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.$4 [L]
    RewriteRule ^products/([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.$5 [L]
    RewriteRule ^products/([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.$6 [L]
    etc..

    which are responsible for this rewrite.

    I believe you identified the problem.  The .htaccess file does not have the ^products/ modification when bleeding edge is installed. The lines are formatted similar to this that I copied.

    RewriteRule ^([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3$4.jpg [L]
×
×
  • Create New...