Jump to content

carlroger

Members
  • Posts

    23
  • Joined

  • Last visited

carlroger's Achievements

Newbie

Newbie (1/14)

2

Reputation

  1. Went over the code again and it's probably because I don't have a base price of the products. All the prices are defined by the attributes. If I change the last line (newPrice) to this, then it works: newPrice = formatCurrency(comboImpact * $('#quantity_wanted').val(), currencyFormat, currencySign, currencyBlank);
  2. Very good but I'm experiencing another problem now. When I reach the discount amount, the price increases. In product.js, I added this: $('#our_price_display').text(formatCurrency(priceWithDiscountsDisplay * $('#quantity_wanted').val(), currencyFormat, currencySign, currencyBlank)).trigger('change'); and this: var combID = $('#idCombination').val(); var combination = combinationsFromController[combID]; if(typeof(combination) != 'undefined') { // check if we need to subtract a % from the combo price if($(this).data('discount-type') == 'percentage') { var comboImpact = combination.price - (combination.price / 100 * $(this).data('discount')); } else { var comboImpact = combination.price; } newPrice = formatCurrency(($(this).data('discount-myvalue') + comboImpact) * $('#quantity_wanted').val(), currencyFormat, currencySign, currencyBlank); } And in product.tpl: <tr id="quantityDiscount_{$quantity_discount.id_product_attribute}" class="quantityDiscount_{$quantity_discount.id_product_attribute}" data-real-discount-value="{convertPrice price = $realDiscountPrice}" data-discount-myvalue="{$realDiscountPrice}" data-discount-type="{$quantity_discount.reduction_type}" data-discount="{$quantity_discount.real_value|floatval}" data-discount-quantity="{$quantity_discount.quantity|intval}"> What am I doing wrong?
  3. Hi, I have two cart rules: 10% off when ordering 15 pcs. and 20% off ordering 30 pcs. All my products have several attributes that increase the price. When I choose 15 or 30 pcs. with the standard product without selected attributes, the price is calculated correctly. But if I choose an attribute, the price is still calculated as if no attribute is chosen. How do I fix this? IMO this is a very critical bug. /Carl
  4. Hi, My Prestashop (1.6.1.9) has two different choices for shipping. One for business customers and one for everyone else. Even though the customer gets informed of this, many customers choose the wrong shipping. The problem is that we can't always "guess" if it's a company address or just a regular one. If it's a regular one and the customer has chosen the company shipping, we get an additional bill from our shipping company. I'd like to be able to add the surcharge to the customers shipping cost if they haven't entered a company name and VAT no. at checkout. Is this possible? /Carl
  5. I know that this is a pretty old post, but I just had the same problem, wanting information from the Custom Field module. Here's the solution: The database table is called 'ps_customer_custom_field_value'. Here you have a cell called 'id_custom_field' and a cell called 'value'. If you want to know which field is which, look into 'ps_custom_field_lang' to get the 'id_custom_field'. You'll have to edit /modules/mailalerts/mailalerts.php. Look for the function public function getAllMessages($id) and below this add the following new function: public function getCustomField($id) { $custom_fields = Db::getInstance()->executeS(' SELECT `value` FROM `'._DB_PREFIX_.'customer_custom_field_value` WHERE `id_customer` = '.(int)$id.' AND `id_custom_field` = 2'); // Set the number corresponding the field you want to get the value from foreach ($custom_fields as $custom_field) $result = $custom_field['value']; return $result; } Now scroll down to: $message = $this->getAllMessages($order->id); if (!$message || empty($message)) $message = $this->l('No message'); and below you'll type $yourCustomField = $this->getCustomField($customer->id); Scroll down to the section // Filling-in vars for email $template_vars = array( and find '{message}' => $message here you change the message and add the line with your custom variable '{message}' => $message, '{customField}' => $yourCustomField Further down in the file, you have a similar section again. Replace the message line one again with the above. Now you have to edit the e-mail template. You'll find it in BO > Localization > Translations. In 'Type of translation' choose 'Email templates translations', your theme and language. Find the 'mailalerts' section and 'new_order' template. Edit the template and add '{customField}' whereever you want. Hope it helps! /Carl
  6. Hi, Maybe the topic title is a little off. I have shipping costs for different countries under control. The problem is that I sell products in Denmark and also Germany. When german customers place an order without being logged in, the danish shipping costs are shown, but when they are logged in, they get the correct german shipping costs. How do I handle this? Best would be for the shipping costs to be added to the checkout summary when the are logged in (Guests are also allowed to buy). Can this be done? I'm running Prestashop Cloud, so direct file editing is somewhat limited. Thanks in advance! /Carl
  7. Just found out that there's a limit in how many attributes I can have. I need about 32640 different attributes and this is clearly too many for PS to handle
  8. Hi, I'm building a new shop with some products having a lot of variants. The problem is that I can't seem to get my head around how to make all the variants. I have these different variants: Size (15 values) Color (17 values) Background color (16 values) Orientation (2 values) Plate (3 values) Fastening (3 values) The sizes are 40, 50, 60, 70, 80, 90, 100, 120, 140, 160, 180, 200, 240, 280, 350. The sizes have a specific price for each value. The color, background color and orientation has no price. The plate is none, ALU or PVC and the price varies depending on the size: ALU from 40 - 90 costs 62.50. From 100 - 140 costs 75. From 160 - 240 costs 100. From 280 to 350 costs 162.50. The price structure is the same for PVC but the price is lower. The fastening is none, holes or adhesive. The price for holes and adhesive is 10. In the variants generator it's easy to auto generate all of the variants (and there are a lot). But I can't figure out how to make the prices for the plate. I can only enter one price for ALU and PVC, so the increment from 90 to 100, 140 to 160 and 240 to 280 isn't working. How to I create the increment? /Carl
  9. Hej, Dem jeg er ved at (prøve) at lave en webshop for, har en ret indviklet prisstruktur. De har 7 forskellige rabatsatser, og forskellige kunder får forskellige rabatsatser på forskellige varer. Hvordan håndterer jeg det i PrestaShop? /Carl
  10. Hej folkens, Jeg har været så dum at sige ja til at hjælpe en virksomhed med at lave en webshop, og desværre føler jeg nu at jeg sidder med hovedet mod en mur. Problemet: Virksomheden sælger folier til indpakning af f.eks. biler. Hver folie sælges enten som hel rulle eller anbrud. Hver folie findes også i x antal farve varianter. Hver rulle findes også i forskellig bredde. Hver variant har hver sit varenummer. Altså findes disse variant grupper: Type (hel/anbrud), farve og bredde. Hvordan styrer jeg det med de forskellige varianter og varenumre? /Carl
  11. Hi, I would like to have my prices showing with VAT when the user is NOT logged in, and show the prices whithout when the user IS logged in. Is this possible? /Carl
  12. Hi experts! I'm working on making my own template, and I'm using Dreamweaver to edit the files. When I save and uploade the *.tpl files I'm editing, nothing happens online. I have to rename the whole template folder and upload it, and select this new template inside Prestasop admin. Isn't it possible just to edit the files and upload, and just hit F5 to refresh? /Carl
  13. Hi, Is it possible to configure the shop, so the price is showed with VAT when the user isn't logged in, and show the price without VAT if the user is logged in? /Carl
×
×
  • Create New...