Jump to content
thirty bees forum

yaniv14

Members
  • Posts

    580
  • Joined

  • Last visited

  • Days Won

    24

Posts posted by yaniv14

  1. This has got nothing to do with thirty bees.

    This error is caused by an override you did for classes/pdf/HTMLTemplateInvoice.php.

    Maybe you used to have this module "gwadvancedinvoice" that came with some lib named "QRCodeLib" and this module did the override for you and now you are not using this module anymore?

  2. Adding currency code to custom code won't do the trick for you.

    This section only helps you if you need to add javascript code, like the script you have from AWIN.

    what you need to do is to add an override.

    your need to create a new file inside override/controllers/front folder and name that file OrderConfirmationController.php

    the content of the file should be something like

    <?php
    class OrderConfirmationController extends OrderConfirmationControllerCore {
    	public function initContent() {
        	$idCart = (int) Tools::getValue('id_cart');
            $idOrder = Order::getOrderByCartId($idCart);
            $order = new Order($idOrder);
          	$currency = new Currency($order->id_currency);
          	$iso_code = $currency->iso_code;
          	$cart_rules = $order->getCartRules();
          	$cart_rules_ids = [];
          	foreach ($cart_rules as $cart_rule) {
            	$cart_rules_ids[] = $cart_rule->id_cart_rule;
            }
          	$cart_rules_ids_str = implode(',', $cart_rules_ids);
          	Media::AddJsDef(
                [
                    'iso_code'          => $iso_code,
                  	'cart_rules_ids'    => $cart_rules_ids_str,
                ]
            );
    
            $this->context->smarty->assign(
                [
                    'iso_code'                => $iso_code,
                  	'cart_rules_ids'          => $cart_rules_ids_str,
                ]
            );
          	return parent::initContent();
        }
    }

    this is not tested and also cart_rules_ids is being passed as a comma separated ids, and I am not sure this is correct with AWIN because I am not familiar with it.

    also in order for the override to work you will need to delete "cache/class_index.php" file.

    hopes it gives you some direction where to start.

  3. this line probably wont work:

     

    AWIN.Tracking.Sale.parts = DEFAULT: total_paid_tax_incl;

    you can try:

    AWIN.Tracking.Sale.parts = `DEFAULT: ${total_paid_tax_incl}`;

    also this line should not be inside {literal} tag and it should be like that.

    <img src="https://www.awin1.com/sread.img?tt=ns&tv=2&merchant=00000&amount={$order->total_paid_tax_incl}&cr={#isoCodeNum#}&ref={$order->id_order}&parts=DEFAULT:{$order->total_paid_tax_incl}&vc={#getOrderedCartRulesIds#}&ch=aw&testmode=0" border="0" width="0" height="0">

    some variables as you can see are not available without overriding the controller so you need to create your override and add them

    like for currency iso code you can do something like

    $currency = new Currency($order->id_currency);

    $iso_core = $currency->iso_code;

  4. Hi,

     

    You cannot use php code like you put.

    Smarty has {php} tag for that, but I think its deprecated and anyway its not recommended.

    What you have in your code is javascript and you should use only available javascript variables that are coming from the controller (server side).

    if you look at this you will see all variables that are injected to your template from the controller.

    So you can use it like that:

    AWIN.Tracking.Sale.amount = total_paid_tax_incl;


    if you need additional data that is not presented by the controller you can create your own override of the controller initContent() function.

    also keep in mind that this controller template will only loads if payment module configure proper usage of payment return and/or redirect success payment to order-confirmation page.

     

    Good luck

  5. 4 hours ago, Tuan Pham said:

    While I have not fully understood the PayPal module code yet, the following change to the modules/paypal/controllers/front/incontextvalidate.php file fixed the issue for me:

    Line 75, change from  

    
    $ppc->id_customer = $this->context->customer->id;

    to

    
    $ppc->id_customer = $customer->id;
    

    My guess is that while the module creates the customer record, the customer has not logged in and thus it is not available in the context.

    I'd appreciate if thirtybees developers can confirm if my change is good or not.

    https://github.com/thirtybees/paypal/commit/781f3ad363df3d1c4968c32d4a73cf9b9bca25d7

  6. 10 hours ago, zen said:

    It's possible also to just use the original images on the templates files, so you can turn off all resized images you don't need anymore to just show on product page, for example, the original pic you uploaded.

    it's pretty easy to modify theme for that : just have to remove the extension-size choosen, without extension it's the original picture that will be loaded.

    I believe you are mistaken. if I remember correctly even the original uploaded image is being recreated.

    So you will never really have the original uploaded file. only a modified lowered quality image.

    • Like 2
  7. You can add it to header.tpl or footer.tpl depends if you want it before closing head or body tags.

    in case your script has curly braces "{ ... }" like the async one you posted, than you should wrap it inside literal tag. e.g.: {literal} your script {/literal}

    Good luck.

    p.s. I believe that @SLiCK_303 suggestion would work as well, but I never tested that feature so I can't tell.

  8. It is normal tb/ps behavior because orders are tied to carrier_id and if you change carrier info (like tracking link) and want to look at old order than you can get the carrier info from that time.

    I really ate this behavior because I believe that the only thing matters in orders are the shipping price and this part already being saved in the order table.

    • Like 3
×
×
  • Create New...