Jump to content

Attrexx

Members
  • Posts

    86
  • Joined

  • Last visited

  • Days Won

    1

Attrexx last won the day on March 17 2018

Attrexx had the most liked content!

1 Follower

About Attrexx

  • Birthday 05/08/1984

Contact Methods

Profile Information

  • Location
    Bucharest
  • First Name
    Alexandru
  • Last Name
    Alexe
  • Activity
    Freelancer

Recent Profile Visitors

931 profile views

Attrexx's Achievements

  1. UPDATE: In the meantime a colleague came up with a solution and has agreed for it to be shared with anyone who would face the same issue. Below are the modifications he made to the controller and the template files. Needless to say, they work flawlessly now. OrderConfirmationController.php new code: $cart = new Cart((int)($this->id_cart)); self::$smarty->assign(array( '_order' => $this->id_order, '_value' => $cart->getOrderTotal() )); $order_id = new Order($this->id_order); $products = $order_id->getProducts(); $product_ids = []; foreach ($products as $product) { $product_ids[] = (int)$product['id_product']; } $this->context->smarty->assign(array( 'order_id' => $this->id_order, 'products' => $products, 'product_ids' => json_encode($product_ids), )); and order-confirmation.tpl new code: <script> fbq('track', 'Purchase', { value: {/literal}'{$_value}'{literal}, currency: {/literal}'{$currency->iso_code}'{literal} , content_ids: {/literal} {$product_ids} {literal}, content_type: 'product', }); </script>
  2. UPDATE: Latest setup outputs ID's but not comma separated. They appear like 1-item individual arrays 😕 like "ID1""ID2" instead of, "ID1,ID2". Also, HTML markup updated. Used same syntax for the "contents:..." bit, and here it outputs correctly... PHP: public function initContent() { parent::initContent(); $order = new Order((int)($this->id_order)); $products = $order->getProducts(); $product_ids = array(); foreach ($products as $product) $product_ids[] = (int)$product['id_product']; $this->context->smarty->assign(array( '$products' => $products, 'id_order' => $this->id_order, 'is_guest' => $this->context->customer->is_guest, 'HOOK_ORDER_CONFIRMATION' => $this->displayOrderConfirmation(), 'HOOK_PAYMENT_RETURN' => $this->displayPaymentReturn() )); $array = explode(', ',$product_ids); if ($this->context->customer->is_guest) { $this->context->smarty->assign(array( 'id_order' => $this->id_order, '$products' => $products, 'reference_order' => $this->reference, 'id_order_formatted' => sprintf('#%06d', $this->id_order), 'email' => $this->context->customer->email )); /* If guest we clear the cookie for security reason */ $this->context->customer->mylogout(); } ... HTML: {literal} <script> fbq('track', 'Purchase', { content_ids: {/literal}{foreach from=$products item="product"}{literal} {/literal}'{$product_ids}'{literal} {/literal}{/foreach}{literal}, content_type: 'product', value: {/literal}'{$_value}'{literal}, currency: 'RON', contents: [ {/literal}{foreach from=$products item="product"}{literal} { id: {/literal}'{$product.product_id}'{literal}, quantity: {/literal}'{$product.product_quantity}'{literal}, item_price: {/literal}'{$product.total_wt}'{literal} } {/literal}{/foreach}{literal} ], }); </script>
  3. Hello guys I need to output a comma separated array of the IDs of the products in the placed order, on the Order Confirmation Page, for Facebook Remarketing. My current code in OrderConfirmationController.php is: public function initContent() { parent::initContent(); $order = new Order((int)($this->id_order)); $products = $order->getProducts(); $product_ids = array(); foreach ($products as $product) $product_ids[] = (int)$product['id_product']; $this->context->smarty->assign(array( '$products' => $products, 'id_order' => $this->id_order, 'is_guest' => $this->context->customer->is_guest, 'HOOK_ORDER_CONFIRMATION' => $this->displayOrderConfirmation(), 'HOOK_PAYMENT_RETURN' => $this->displayPaymentReturn() )); if ($this->context->customer->is_guest) { $this->context->smarty->assign(array( 'id_order' => $this->id_order, '$products' => $products, 'reference_order' => $this->reference, 'id_order_formatted' => sprintf('#%06d', $this->id_order), 'email' => $this->context->customer->email )); /* If guest we clear the cookie for security reason */ $this->context->customer->mylogout(); } and on the order-confirmation.tpl I got this: {literal} <script> fbq('track', 'Purchase', // {/literal} // {foreach from=$products item=product name=item} // {literal} { content_ids: ['{/literal}{$product_ids}{literal}'], content_type: 'product', value: '{/literal}{$_value}{literal}', currency: 'RON' }); // {/literal} // {/foreach} // {literal} </script> <!-- End Facebook Pixel Code --> {/literal} As you can see, I commented a {foreach} because I tried A LOT of suggestions here on the forum without good results and on the current setup I have the array generated in the PHP file. The current output is none. Previous attempts have output either all the IDs united into one, without separation (which actually lead me to this endeavor) or just one product ID. I am getting errors across all sites using this setup and it impacts my clients. Please help? Thank you!
  4. Hey all, I keep struggling at finding a way to achieve something that, as far as I know, Prestashop can't do by itself, and that is setting a different format (let's say a VERTICAL one) for a certain category, as opposed to the rest of the categories where I could use the default format, ie. SQUARED. Do you have any ideas on how one could get something like this in Prestashop PS1.6? I need it for a store that sells shoes (squared pics) but now wants to add a special category with clothing (vertical pics) and resizing/fitting/cropping the clothing images to fit in the square format has a major negative impact on user experience and product showcasing. Any idea is welcomed! Thanks a bunch.
  5. What op is seeking is a module that displays Facebook Page Reviews, not product reviews. It helps with building brand trust. As far as I know you can embed some reviews of your choosing via HTML using Facebooks own Embed Post feature. Of course, a dynamic module, with a rating filter too (you don't want those 1-2-star bad reviews on your shop), would be great.
  6. I am sorry to bring this baby back into attention but we still struggle with this issue. Situation is as follows: - site: https://larysa.ro (running on PS 1.6.1.9) - we absolutely need unique product image names and ALTs for SEO purposes - using the provided drop-down on Images tab of product edit page, meant to assign different ALT fields to each image is time consuming, because we have to edit product-by-product, image by image. We have hundreds of products, with ~5 images each I am just wondering if any of the below ideas are feasible: For future uploads: Can't we create an override to a controller to automatically add an unique identifier to each image name/ALT? Like versioning? For existing images: Can't we obtain an SQL query to pull each image name/ALT and attach to it an unique identifier? I know it's shooting in the dark but we are really desperate to find a solution to this after realizing PS does not really like unique fields when it comes to product images
  7. Hello. I am trying to move the product filters from the left column to the center one, above the products. This is a feature many users have requested/used in the past. I used to apply the below method to 1.6 versions, but now we have different module for filters and I don't want to screw things up. https://www.prestashop.com/forums/topic/301276-moving-filter-block-from-left-column-to-top-of-product-list/ As a bonus, I am going to try and hide the filters on desktop like they hide on mobile, showing at first just a "Show filters" toggle button and displaying them on customer click. If you have a suggestion on that aspect too, it would be awesome. I would prefer using overrides, but direct method is possible too. Many thanks and Happy Holidays to all.
  8. You could try this module. It's the only one I could find. But beware the developer speaks almost zero English (she's from Spain). I'll get it for testing but it seems to do the trick! https://www.alabazweb.com/en/prestashop-modules-to-improve-usability/299-it-allows-to-share-files-between-administrator-and-client-module.html
  9. You could try this module. It's the only one I could find. But beware the developer speaks almost zero English (she's from Spain). I'll get it for testing but it seems to do the trick! https://www.alabazweb.com/en/prestashop-modules-to-improve-usability/299-it-allows-to-share-files-between-administrator-and-client-module.html
  10. You could try this module. It's the only one I could find. But beware the developer speaks almost zero English (she's from Spain). I'll get it for testing but it seems to do the trick! https://www.alabazweb.com/en/prestashop-modules-to-improve-usability/299-it-allows-to-share-files-between-administrator-and-client-module.html
  11. You specified this problem of yours was solved but did not post the solution for it. Not cool, OP
×
×
  • Create New...