Jump to content

shaktishakya

Members
  • Posts

    8
  • Joined

  • Last visited

Profile Information

  • Activity
    Developer

shaktishakya's Achievements

Newbie

Newbie (1/14)

1

Reputation

  1. Hi, I need to have the same thing in my cart rule. Has anyone succeeded to get the total order amount range to work?
  2. I am having serious problem losing all the context and cookie when a payment gateway tries to detect the output from one of the methods of my module. During payment, user is redirected to the 3rd party website (gateway site), makes payment during which it internally scan given module url. I had to output "0" for the gateway for final verification of the payment. This is a crucial step, since that is the point where the order has to be saved into the db. When I check the prestashop cookies and context, they all appear unset, but if I visit the url directly in the browser all appears in place. I would appreciate anyone's help.
  3. Add the following function somewhere in product.js file. You may add this just above the function updateDisplay() definition. Note that I used another div element having id 'total_qty_price' to display the updated price. function displayTotalPriceByQty( unit_price ){ total_qty_price = $('#total_qty_price'); qty_wanted = parseInt($('#quantity_wanted').val()); if( typeof unit_price == 'undefined' || unit_price == '' ) unit_price = productPrice; if(qty_wanted > 0){ if(qty_wanted == 1) total_qty_price.hide('fast'); else if(unit_price > 0){ total_qty_price.show('fast'); total_price = formatCurrency((unit_price * qty_wanted), currencyFormat, currencySign, currencyBlank); total_qty_price.text( '= ' + total_price); } }else{ total_qty_price.hide('fast'); } } Replace: if (productPriceDisplay > 0) { our_price = formatCurrency(productPriceDisplay, currencyFormat, currencySign, currencyBlank); } else { our_price = formatCurrency(0, currencyFormat, currencySign, currencyBlank); } With: if (productPriceDisplay > 0) { displayTotalPriceByQty(productPriceDisplay); our_price = formatCurrency(productPriceDisplay, currencyFormat, currencySign, currencyBlank); } else { displayTotalPriceByQty(0); our_price = formatCurrency(0, currencyFormat, currencySign, currencyBlank); } Lastly, call functions at the end of click event on '.product_quantity_up' and '.product_quantity_down' as: if($('.attribute_list').length) updateDisplay(); else calculateTotalQtyPrice();
  4. I need to add more than one category trees to a module form. While trying to do so, I see all the trees appearing in the output, however the other trees do not function properly. A deeper look revealed that the other rendered trees are taking the same id specified for the first one. Below is the piece of the input array 'input' => array( array( 'type' => 'text', 'label' => $this->l('Block Name'), 'name' => 'block_name' ), array( 'type' => 'categories', 'label' => $this->l('Root category'), 'name' => 'id_root_category', 'tree' => array( 'id' => 'id_root_category', ) ), array( 'type' => 'categories', 'label' => $this->l('Exclude categories'), 'name' => 'exclude_cats', 'tree' => array( 'id' => 'exclude_cats', 'use_checkbox' => true ), ), ... ... ) The helperForm class does not seem to allow more than one such trees by its code. The use of $categories variable is controlling the number of tree per form. You can see that below. case 'categories': if ($categories) { $tree = new HelperTreeCategories($params['tree']['id'], isset($params['tree']['title']) ? $params['tree']['title'] : null); if (isset($params['name'])) $tree->setInputName($params['name']); if (isset($params['tree']['selected_categories'])) $tree->setSelectedCategories($params['tree']['selected_categories']); if (isset($params['tree']['disabled_categories'])) $tree->setDisabledCategories($params['tree']['disabled_categories']); if (isset($params['tree']['root_category'])) $tree->setRootCategory($params['tree']['root_category']); if (isset($params['tree']['use_search'])) $tree->setUseSearch($params['tree']['use_search']); if (isset($params['tree']['use_checkbox'])) $tree->setUseCheckBox($params['tree']['use_checkbox']); $this->context->smarty->assign('categories_tree', $tree->render()); $categories = false; } break; Does anyone have any solution?
  5. Made changes in the file "controllers/front/submit.php" I defined PAYPAL_FORCE_CURRENCY before the class definition. Then, public function initContent() { ..... 'price' => Tools::displayPrice($paypal_order['total_paid'], PAYPAL_FORCE_CURRENCY), ..... $order_currency = new Currency((int)$order->id_currency); $display_currency = new Currency(PAYPAL_FORCE_CURRENCY); $price = $paypal_order['total_paid']; ..... ..... $this->context->smarty->assign( array( 'is_guest' => (($this->context->customer->is_guest) || $this->context->customer->id == false), 'order' => $paypal_order, 'price' => Tools::displayPrice($price, PAYPAL_FORCE_CURRENCY), ...... }
  6. Thanks for your quick reply. I managed to fix it by making adjustments in few files.
  7. Hello Eli, You have saved hours of mine fixing the bug in paypal module. Everything looks good until I found myself stuck at one final things. After it redirects back to prestashop, the amount stays in the converted price, while currency symbol is correct, in the return (order confirmation) page. For example, the order confirmation page shows Total of the transaction (taxes incl.) : Rs. 6.19 The currency shown here is fine, while the amount figure is the Dollar converted figure, which Paypal used for the transaction. I should get back the original amount in Rs. Thanks in advance.
×
×
  • Create New...