Jump to content

Rissinko

Members
  • Posts

    94
  • Joined

  • Last visited

Profile Information

  • Location
    Slovakia
  • Activity
    Other

Recent Profile Visitors

6,465,748 profile views

Rissinko's Achievements

  1. Hello colleagues developers, I just have one question. I am working on override of one payment module because i want to have confirmation page to confirm order before it creation. I came to some specific problem. What I want to do is to override module to add this confirmation page with new front controller for this page but this module is not contain this new front controller. So may question is : Is there any possibility how to refer from override paymentoption to front controller created only in module override folder ? I don't want to create this file in module because i want to have clean module installation to be able do fast update. I am overriding hookPaymentOptions which look like this : $formAction = $this->context->link->getModuleLink($this->name, 'MYOWNCONFIRMATIONCONTROLLER', array(), true); $this->smarty->assign( $this->getTemplateVarInfos(), ['action' => $formAction] ); $paymentForm = $this->fetch('module:cardpay/views/templates/front/MYOWNCONFIRMATIONPAGE.tpl'); $newOption = new PaymentOption; $newOption->setModuleName($this->displayName) ->setCallToActionText($this->displayName) ->setAction($formAction) ->setForm($paymentForm); //$payment_options = array($newOption); $payment_options = [ $newOption, ]; I am able to reach this MYOWNCONFIRMATIONCONTROLLER and page but only if i will create this file in module folder. But what i want to create this files only in override/modules/MYMODULE/Controller folder.
  2. Hello any news about this i have same problem. Did you solved this issue ?
  3. Ok problem solved i used ajax call which will run function when checkbox is checked or unchecked.
  4. Thanks it was mistake but it is not the problem why it not working.
  5. I think another way will be use ajax call but i am not sure how to do that.
  6. hmm ok look at it maybe you will see problem because i don't have a clue what is wrong. OrderOPCController.php - here iam calling exec of my new actionhook –> hookactionbeforesummary protected function _assignPayment() { if ((bool)Configuration::get('PS_ADVANCED_PAYMENT_API')) { $this->context->smarty->assign(array( 'HOOK_TOP_PAYMENT' => ($this->isLogged ? Hook::exec('displayPaymentTop') : ''), 'HOOK_PAYMENT' => $this->_getPaymentMethods(), 'HOOK_ADVANCED_PAYMENT' => Hook::exec('advancedPaymentOptions', array(), null, true), 'link_conditions' => $this->link_conditions )); } else { $this->context->smarty->assign(array( 'HOOK_TOP_PAYMENT' => ($this->isLogged ? Hook::exec('displayPaymentTop') : ''), 'HOOK_PAYMENT' => $this->_getPaymentMethods() )); } Hook::exec('hookactionbeforesummary',array()); } And my modul php file. public function install() { if (!parent::install() . . . || !$this->registerHook('displayGdprOrder') || !$this->registerHook('actionbeforesummary')) { return false; } } public function hookdisplayGdprOrder($params) { $this->smarty->assign('heureka_message', $this->l('checkbox text')); return $this->display(__FILE__, 'orderprocess.tpl', $this->getCacheId()); } public function hookactionbeforesummary($params) { if(Configuration::get('PS_ORDER_PROCESS_TYPE') == 1) { if (Tools::getValue('heureka_checkbox') == '1') { $data = array( 'id_cart' => $params['cart']->id, 'id_customer' => $params['cart']->id_customer, 'value' => $suhlas, ); Db::getInstance()->insert('heureka_suhlas', $data); } } } orderprocessheureka.tpl file which is hooked to hookdisplayGdprOrder and this hook is showed under checkbox for terms and conditions . <div class="error_customerprivacy" style="color:red;"></div> <fieldset class="account_creation heureka"> <div style="width:21px; float:left;"> <div class="required checkbox"> <input type="checkbox" value="1" id="heureka_checkbox" name="heureka_checkbox" autocomplete="off"/> </div> </div> <div style="width: 92%; float: left; margin-top: 8px;"> <label for="customer_privacy" style="font-weight: normal;">{$heureka_message}</label> </div> </fieldset>
  7. @phinq1910 Yes i tried this solution before but i was not successful. I tried exec hook in OrderOpcController.php in _assignPayment but it didn't work. I wanted to add hook exec after choosing the payment method. So you will choose payment then actionhook will save data and then you will be redirect to the execution payment page where is button "i confirm my order".
  8. Hello, Any one who can help me with the problem... Is there any way how to exec action hook on onepage checkout for example when i will click on PAYMENT METHOD ? My scenario : i have checkbox and when it is checked i need to insert value to the database. In normal 5 step checkout i used hookactionCarrierProcess but onepage checkout doesn't use this actionhook.
  9. Hi, Is there anyone who have the same problem with order message on prestashop 1.7 ?? Messages are inserted to the database as decoded utf 8 . Example how looks the messages : &aacute;no m&aacute;m
  10. Solved.. I found in Cart class funcion getSummaryDetails() which contains informations about gifts in cart.
  11. This flag is in shopping-cart-product-line.tpl it shows when the product is added from cart rule like gift to the order....I really like to give you these informations but i don't know this is why i am looking for help because i can't find anything about it here and in prestashop codes/tables also.
  12. So i tried to load object and print_r array but no gift info there... public static function getProductInfo($product_id) { $product = new Product ($product_id, $lang->id); print_r($product); } So anyone who knows where is this gift info stored or which class creating/using it ? Thanks
  13. I am on 1.6 ...yes i think that i need load product object but i had some issues with it....
  14. Maybe i didn't write it right so i try it again.. I am working on summary page in bankwire module. I know that in shopping-cart-product-line.tpl there is variable $product.gift And i need to know from what class i get it or how i can get it on my custom page because class Cart.php and function getproducts do not contain this info in array. maybe it is from class Product but i somehow can't get info from this class in module...
  15. Here is the picture of the code and print_r of the $product from shopping-cart-product-line.tpl gift is as last info in array... Array ( [id_product_attribute] => 0 [id_product] => 691 [cart_quantity] => 1 [id_shop] => 1 [name] => Reklamné pero [is_virtual] => 0 [description_short] => Reklamné pero Tvojakáva. Darček k objednávke. [available_now] => [available_later] => ZASIELAME IHNEĎ [id_category_default] => 180 [id_supplier] => 0 [id_manufacturer] => 0 [on_sale] => 0 [ecotax] => 0.000000 [additional_shipping_cost] => 0.00 [available_for_order] => 1 [price] => 0 [active] => 1 [unity] => [unit_price_ratio] => 0.000000 [quantity_available] => -165 [width] => 0.000000 [height] => 0.000000 [depth] => 0.000000 [out_of_stock] => 2 [weight] => 0.000000 [date_add] => 2017-04-21 13:27:45 [date_upd] => 2017-07-24 13:00:06 [quantity] => 1 [link_rewrite] => reklamne-pero [category] => darceky [unique_id] => 00000006910000000000778 [id_address_delivery] => 778 [advanced_stock_management] => 0 [supplier_reference] => [customization_quantity] => [id_customization] => [reference] => [ean13] => [upc] => [minimal_quantity] => 1 [wholesale_price] => 0.000000 [id_image] => 6[spam-filter]1133 [legend] => Reklamné pero [reduction_type] => 0 [stock_quantity] => -165 [price_without_reduction] => 0.5 [price_with_reduction] => 0.5 [price_with_reduction_without_tax] => 0.416667 [total] => 0 [total_wt] => 0 [price_wt] => 0 [reduction_applies] => [quantity_discount_applies] => [allow_oosp] => 1 [features] => Array ( ) [rate] => 20 [tax_name] => DPH SK 20% [price_without_quantity_discount] => 0.5 [reduction_formatted] => 0,00 € [gift] => 1 )
×
×
  • Create New...