-
Posts
435 -
Joined
-
Last visited
-
Days Won
5
Content Type
Profiles
Forums
Gallery
Downloads
Articles
Store
Blogs
Everything posted by Pedalman
-
Thank you, I got that working. Just out of curiosity, I tried to copy the addtions to an override. Never did that before, so I like to ask, if the following is fine, or if it even could be made more concise. <?php class HTMLTemplateInvoiceCore extends HTMLTemplateCore { public function getContent() { $invoiceAddressPatternRules = json_decode(Configuration::get('PS_INVCE_INVOICE_ADDR_RULES'), true); $deliveryAddressPatternRules = json_decode(Configuration::get('PS_INVCE_DELIVERY_ADDR_RULES'), true); $invoiceAddress = new Address((int) $this->order->id_address_invoice); $country = new Country((int) $invoiceAddress->id_country); $formattedInvoiceAddress = AddressFormat::generateAddress($invoiceAddress, $invoiceAddressPatternRules, '<br />', ' '); $deliveryAddress = null; $formattedDeliveryAddress = ''; if (isset($this->order->id_address_delivery) && $this->order->id_address_delivery) { $deliveryAddress = new Address((int) $this->order->id_address_delivery); $formattedDeliveryAddress = AddressFormat::generateAddress($deliveryAddress, $deliveryAddressPatternRules, '<br />', ' '); } $customer = new Customer((int) $this->order->id_customer); $carrier = new Carrier((int) $this->order->id_carrier); $orderDetails = $this->order_invoice->getProducts(); $order = new Order($this->order_invoice->id_order); $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']); } // Set tax_code $taxes = OrderDetail::getTaxListStatic($id); $taxTemp = []; foreach ($taxes as $tax) { $obj = new Tax($tax['id_tax']); $taxTemp[] = sprintf($this->l('%1$s%2$s%%'), (float) round($obj->rate, 3), ' '); } $orderDetail['order_detail_tax'] = $taxes; $orderDetail['order_detail_tax_label'] = implode(', ', $taxTemp); } unset($taxTemp); unset($orderDetail); if (Configuration::get('PS_PDF_IMG_INVOICE')) { foreach ($orderDetails as &$orderDetail) { if ($orderDetail['image'] instanceof Image) { $imageId = (int)$orderDetail['image']->id; $orderDetail['image_tag'] = preg_replace( '/\.*'.preg_quote(__PS_BASE_URI__, '/').'/', _PS_ROOT_DIR_.DIRECTORY_SEPARATOR, ImageManager::getProductImageThumbnailTag($imageId, false), 1 ); $imagePath = ImageManager::getProductImageThumbnailFilePath($imageId); if (file_exists($imagePath)) { $orderDetail['image_size'] = getimagesize($imagePath); } else { $orderDetail['image_size'] = false; } } } unset($orderDetail); // don't overwrite the last order_detail later } $cartRules = $this->order->getCartRules(); $freeShipping = false; foreach ($cartRules as $key => $cartRule) { if ($cartRule['free_shipping']) { $freeShipping = true; /** * Adjust cart rule value to remove the amount of the shipping. * We're not interested in displaying the shipping discount as it is already shown as "Free Shipping". */ $cartRules[$key]['value_tax_excl'] -= $this->order_invoice->total_shipping_tax_excl; $cartRules[$key]['value'] -= $this->order_invoice->total_shipping_tax_incl; /** * Don't display cart rules that are only about free shipping and don't create * a discount on products. */ if ($cartRules[$key]['value'] == 0) { unset($cartRules[$key]); } } } $productTaxes = 0; foreach ($this->order_invoice->getProductTaxesBreakdown($this->order) as $details) { $productTaxes += $details['total_amount']; } $productDiscountsTaxExcl = $this->order_invoice->total_discount_tax_excl; $productDiscountsTaxIncl = $this->order_invoice->total_discount_tax_incl; if ($freeShipping) { $productDiscountsTaxExcl -= $this->order_invoice->total_shipping_tax_excl; $productDiscountsTaxIncl -= $this->order_invoice->total_shipping_tax_incl; } $productsAfterDiscountsTaxExcl = $this->order_invoice->total_products - $productDiscountsTaxExcl; $productsAfterDiscountsTaxIncl = $this->order_invoice->total_products_wt - $productDiscountsTaxIncl; $shippingTaxExcl = $freeShipping ? 0 : $this->order_invoice->total_shipping_tax_excl; $shippingTaxIncl = $freeShipping ? 0 : $this->order_invoice->total_shipping_tax_incl; $shippingTaxes = $shippingTaxIncl - $shippingTaxExcl; $wrappingTaxes = $this->order_invoice->total_wrapping_tax_incl - $this->order_invoice->total_wrapping_tax_excl; $totalTaxes = $this->order_invoice->total_paid_tax_incl - $this->order_invoice->total_paid_tax_excl; $footer = [ 'products_before_discounts_tax_excl' => $this->order_invoice->total_products, 'product_discounts_tax_excl' => $productDiscountsTaxExcl, 'products_after_discounts_tax_excl' => $productsAfterDiscountsTaxExcl, 'products_before_discounts_tax_incl' => $this->order_invoice->total_products_wt, 'product_discounts_tax_incl' => $productDiscountsTaxIncl, 'products_after_discounts_tax_incl' => $productsAfterDiscountsTaxIncl, 'product_taxes' => $productTaxes, 'shipping_tax_excl' => $shippingTaxExcl, 'shipping_taxes' => $shippingTaxes, 'shipping_tax_incl' => $shippingTaxIncl, 'wrapping_tax_excl' => $this->order_invoice->total_wrapping_tax_excl, 'wrapping_taxes' => $wrappingTaxes, 'wrapping_tax_incl' => $this->order_invoice->total_wrapping_tax_incl, 'ecotax_taxes' => $totalTaxes - $productTaxes - $wrappingTaxes - $shippingTaxes, 'total_taxes' => $totalTaxes, 'total_paid_tax_excl' => $this->order_invoice->total_paid_tax_excl, 'total_paid_tax_incl' => $this->order_invoice->total_paid_tax_incl, ]; $decimals = 0; if ((new Currency($this->order->id_currency))->decimals) { $decimals = Configuration::get('PS_PRICE_DISPLAY_PRECISION'); } foreach ($footer as $key => $value) { $footer[$key] = Tools::ps_round( $value, $decimals, $this->order->round_mode ); } $displayProductImages = Configuration::get('PS_PDF_IMG_INVOICE'); $taxExcludedDisplay = Group::getPriceDisplayMethod($customer->id_default_group); $layout = $this->computeLayout(['has_discount' => $hasDiscount]); $legalFreeText = Hook::exec('displayInvoiceLegalFreeText', ['order' => $this->order]); if (!$legalFreeText) { $legalFreeText = Configuration::get('PS_INVOICE_LEGAL_FREE_TEXT', (int) Context::getContext()->language->id, null, (int) $this->order->id_shop); } $data = [ 'order' => $this->order, 'order_invoice' => $this->order_invoice, 'order_details' => $orderDetails, 'carrier' => $carrier, 'cart_rules' => $cartRules, 'delivery_address' => $formattedDeliveryAddress, 'invoice_address' => $formattedInvoiceAddress, 'addresses' => ['invoice' => $invoiceAddress, 'delivery' => $deliveryAddress], 'tax_excluded_display' => $taxExcludedDisplay, 'display_product_images' => $displayProductImages, 'layout' => $layout, 'customer' => $customer, 'footer' => $footer, 'legal_free_text' => $legalFreeText, 'other' => $invoiceAddress->other, 'other2' => $deliveryAddress->other ]; $this->smarty->assign($data); $tpls = [ 'style_tab' => $this->smarty->fetch($this->getTemplate('invoice.style-tab')), 'addresses_tab' => $this->smarty->fetch($this->getTemplate('invoice.addresses-tab')), 'summary_tab' => $this->smarty->fetch($this->getTemplate('invoice.summary-tab')), 'product_tab' => $this->smarty->fetch($this->getTemplate('invoice.product-tab')), 'tax_tab' => $this->getTaxTabContent(), 'payment_tab' => $this->smarty->fetch($this->getTemplate('invoice.payment-tab')), 'note_tab' => $this->smarty->fetch($this->getTemplate('invoice.note-tab')), 'total_tab' => $this->smarty->fetch($this->getTemplate('invoice.total-tab')), 'shipping_tab' => $this->smarty->fetch($this->getTemplate('invoice.shipping-tab')), ]; $this->smarty->assign($tpls); return $this->smarty->fetch($this->getTemplateByCountry($country->iso_code)); } }
-
I just managed to add the code to determine the language via the form Thirtybees offers natively in order to add custom html css js code:
-
How did it go? I am looking for a Google Reviews integration, too. At the moment I have it integrated via an old version for an GTM module from Prestashop. Issue is that the module presents customers the badge in English and our shop is hosted in Germany. I have no clue how to set the review module to a specific language, e.g. German.
-
Hello, just reviving this thread. Does anyone have some new tips on a nice GTM layers module except the one I posted? I may be in need to rebuy it, but the price is pretty heavy for us.
-
That I did, but seems that if it is working that way that I am missing to reference it in my invoice template. Can you tell me how to add it to the invoice.summary.pdf, please?
-
I need to add information that is saved during adress sign up in the field 'other' on invoice. I added into to invoice.summary.pdf {if $addresses.invoice->other} <tr> <td class="payment left small grey bold" width="44%">{l s='Invoice Number' pdf='true'}</td> <td class="payment left white" width="56%"> <table width="100%" border="0"> <tr> <td class="right small">{$addresses.invoice->other}</td> </tr> </table> </td> </tr> {/if} and added also the field other to HTMLTemplateInvoice.php $data = [ 'order' => $this->order, 'order_invoice' => $this->order_invoice, 'order_details' => $orderDetails, 'carrier' => $carrier, 'cart_rules' => $cartRules, 'delivery_address' => $formattedDeliveryAddress, 'invoice_address' => $formattedInvoiceAddress, 'addresses' => ['invoice' => $invoiceAddress, 'delivery' => $deliveryAddress], 'tax_excluded_display' => $taxExcludedDisplay, 'display_product_images' => $displayProductImages, 'layout' => $layout, 'customer' => $customer, 'footer' => $footer, 'legal_free_text' => $legalFreeText, 'other' => $other, ]; $this->smarty->assign($data); Well, since I had almost no idea what I am doing and tried at least. But to no success. So, how can I achive that information a customer adds during sign up into the field 'other' is displayed on the invoice?
-
Ok, weekend has started for me and my children are making noise as usual, but I doubt I would understand here which field is the right one even if it were Monday morning 🙂 I tried context:company but to no avail. Assuming that I can assign a condition (updated field in my case) and the cron is running each sec, which might be a no-go to do, I wonder if I can reach my goal. All I want is that only customers who fill out the field company are assigned to a customer group that is allowed to make use of a certain payment option. All others customers shall not see this payment option. Since I choose also Chex I wonder if such a 'real-time' change in payment options is possible. PS: I wish you a nice and refreshing weekend, too.
-
custom email template and AdvancedEUCompliance module
Pedalman replied to Pedalman's question in Module help
perfect Datakick! Thank you very much, that makes my issues crystal clear and I will see what I can do about my problem (non English TB version). -
Ehm, well I am pretty sure that it is not working. I tried it once... Question was, how I can accomplish that a customer is assigned a certain customer group when he/she fills out or updates the company field during checkout, address registration.
-
Hello I like to make use of the great Conseq Module from Datakick. : At registration or address update, each time a customer fills out or updates the 'company' field the customer shall be assigned an additional 'group', e.g. 'vips'.
-
Hello I want to use some custom emails and email states. The problem is I want that the AdvEUComp. module adds the legal text fields I choose in the module but my custom emails do not show up in the module. Waht can I do? Is this configured in the module or in the db? I can hardly remember that Presta did seperate between email templates that come with the installation and ones you create (custom).
-
Hallo wir bieten unseren Kunden PayPal und Kauf auf Rechnung von Klarna via dem Payment Service Provider Mollie an. Bisher läuft PayPal auch über Mollie. Jedoch um Nebenkosten zu sparen würde ich gern das von Datakick gepflegte Thirtybee's PayPal Modul direkt nutzen. Nun frage ich mich, ob ich noch weiterhin bei Mollie bleiben soll (PS 1.6x unterstützen sie eh nicht mehr)... Ich brauche also eine Möglichkeit, meinen Kunden den Rechnungskauf anzubieten. Hier gibt es ja auch PayPal Plus mit RK.... aber ist es besser als Klarna? Wie habt Ihr Klarna eingebunden bzw. welchen Dienst nutzt Ihr? Was haltet ihr vom RK via PayPal? PS: Ich vermute mal, dass die Dienst schon in Europa sitzen sollten und es einfach ist, die Unterlagen für die Buchhaltung (Transaktionslisten etc.) zu erhalten.
-
Ok, I need a list of the glitches and fixes for Warehouse. I am in doubt that we will see another theme as an option with fewer glitches for months. Despite this assumption, I am willing to pay even 250Euro for a theme that fulfills our wills and is maintained here.
-
Couple of issues with Warehouse and php8
Pedalman replied to the.rampage.rado's question in Technical help
Since I am plan to restart my shop with Musicmasters migration tool and warehouse on TB I am asking if it would be possible to create a sub forum for working or generally used themes with TB like Warehouse. (Last time I wanted to build my shop with warehouse I found in Sunny's forum some posts about postfixes and some patches for TB as far as I remember. So it would be perfectly helpful if those tips would be gathered here in a subforum.) -
When using core updater module I run into this message: Duplicate entry '676-118-7816-0-0000-00-00 00:00:00-0000-00-00 00:00:00-0-0-0-0-0' for key 'id_product_2' Can someone hint me how to deal with this?
-
Well, since I am not ranking anymore in organic searches due to the expertise of THE OTHERS I am very much dependent on price comparison like Google Shopping. For this I use the Merchant Center and if prices of my products are right conversion are also... Well, what shall I say? I don't know what you mean with "G ingest of products" ... In a nutshell, I am really no expert and can hardly give any advice.
-
You are absolute right! I just exchanged the line but did not notice that in my case the line was closed in the following line 😞 and my change resulted in double closing (" } }"). Much too hot in my office right now... Much more important, the export works again! Many thanks to you again! And thank you for taking your time and patience!
-
Hello Datakick! It results in this log error and results in 500 for whole admin page: syntax error, unexpected 'else' (T_ELSE) at line 2271 in file classes/module/Module.php(966) : eval()'d code
-
Hello I just updated a few days ago to the latest bleeding edge TB and noticed an extreme decline in my active products listed or exported for Google Shopping feed. I use the above module gshoppingflux despite I also own DataKick. https://github.com/dim00z/gshoppingflux I think the issue may be related to combinations of articles. At the moment, only products with combinations are being exported via the module. If I disable the option to export combinations, all products without combinations are being exported. That is fine. But! as said, with the option on only combinations and no normal articles a being exported. I did not change a thing, except I updated TB. So, could TB be the culprit in this case?
-
As most of us I receive mails from other stores and 3rd party companies daily. My mail program Thunderbird shows the company name of those in the field 'from'. In the case of my Thirtybees installation the mails I send show under this field my mail adress like "[email protected]" How can I change this?
-
I would appreciate the additonal function to move arround / reposition the filed for customer registration. I am thinking especially about the forms/field "company" and "Vat ID" since >90% of our customers are private persons. Therefore it makes sense for me to move these two forms more to the buttom. If the integration is too time consuming at the moment I would like to know how to achieve this myself. I could not find any 'template' in the views folder of Chex.
-
Hello since I am in the process of playing around with my local testing environment (I use XAMPP) I had the idea to set up a 'CDN' for my images. This could be handy, so I would not need to download all my images from my host (thirtybees/img ) each time I make a backup from my live shop. Each time I make a backup from my live shop I skip the img folder, setup the localhost copy of my live shop and link /img to a CDN... Typically I would end up as usual with several version of my liveshop under the XAMPP localhost but would have only one /img folder. I am sure that this is possible with system's symlink but if I could easily turn it on and off in shops backoffice... I would prefer that. Any ideas or comments if it is possible and make sense?