Jump to content

Sridhar09

Members
  • Posts

    3
  • Joined

  • Last visited

About Sridhar09

  • Birthday 09/02/1996

Profile Information

  • First Name
    Sridhar
  • Last Name
    Mundra

Recent Profile Visitors

98 profile views

Sridhar09's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. if(Tools::getValue('taxExempt')) { $file = $_FILES['taxExempt']; $allowed = array('pdf', 'png', 'jpeg', 'gif', 'jpg'); $extension = pathinfo($file['name'], PATHINFO_EXTENSION); if ( file_exists($file['tmp_name']) && in_array($extension, $allowed) ) { $filename = uniqid()."-".basename($file['name']); $filename = str_replace(' ', '-', $filename); $filename = strtolower($filename); $filename = filter_var($filename, FILTER_SANITIZE_STRING); $file['name'] = $filename; $uploader = new UploaderCore(); $uploader->upload($file); $this->customer->taxExempt = $filename; } } I have added this code to IdentityController.php in the function "public function postProcess". I have also added the "taxExempt" form uploader field in identity.tpl. This is already working in the authorization page, So I am pretty sure it is not an issue with the database or Customer.php. But this code does not work. Any ideas??
  2. I know this is an old comment but for any looking for a solution here, you can try public static function getProductTaxRate($id_product, $id_address = null, Context $context = null) { if ($context == null){ $context = Context::getContext(); } $address = Address::initialize($id_address); $groups = Customer::getGroupsStatic((int)($address->id_customer)); $taxratenew; foreach ($groups as $g){ if ($g == 5){ //set the group you want here ( '>;' or '=') $taxratenew = 0; } } if(!isset($taxratenew)){ $id_tax_rules = (int)Product::getIdTaxRulesGroupByIdProduct($id_product, $context); $tax_manager = TaxManagerFactory::getManager($address, $id_tax_rules); $tax_calculator = $tax_manager->getTaxCalculator(); $taxratenew = $tax_calculator->getTotalRate(); } return $taxratenew; } } File : /classes/tax/Tax.php Do not forget to override it in override/classes/tax/Tax.php The solution works in 1.6.0.x
  3. I have followed the steps given here & edited my Product.js file as this - Modified function editProductAttribute ( & fill Combination) : function editProductAttribute (url, parent){ $.ajax({ url: url, data: { id_product: id_product, ajax: true, action: 'editProductAttribute' }, context: document.body, dataType: 'json', context: this, async: false, success: function(data) { // color the selected line parent.siblings().removeClass('selected-line'); parent.addClass('selected-line'); $('#add_new_combination').show(); $('#attribute_quantity').show(); $('#product_att_list').html(''); self.removeButtonCombination('update'); scroll_if_anchor('#add_new_combination'); var wholesale_price = Math.abs(data[0]['wholesale_price']); var price = data[0]['price']; var weight = data[0]['weight']; var unit_impact = data[0]['unit_price_impact']; var reference = data[0]['reference']; var packing_per_bale = data[0]['packing_per_bale'] var ean = data[0]['ean13']; var quantity = data[0]['quantity']; var image = false; var product_att_list = new Array(); for(i=0;i<data.length;i++) { product_att_list.push(data[i]['group_name']+' : '+data[i]['attribute_name']); product_att_list.push(data[i]['id_attribute']); } var id_product_attribute = data[0]['id_product_attribute']; var default_attribute = data[0]['default_on']; var eco_tax = data[0]['ecotax']; var upc = data[0]['upc']; var minimal_quantity = data[0]['minimal_quantity']; var available_date = data[0]['available_date']; if (wholesale_price != 0 && wholesale_price > 0) { $("#attribute_wholesale_price_full").show(); $("#attribute_wholesale_price_blank").hide(); } else { $("#attribute_wholesale_price_full").hide(); $("#attribute_wholesale_price_blank").show(); } self.fillCombination( wholesale_price, price, weight, unit_impact, reference, packing_per_bale, ean, quantity, image, product_att_list, id_product_attribute, default_attribute, eco_tax, upc, minimal_quantity, available_date ); calcImpactPriceTI(); } }); } }; - and function call of fillCombination this.fillCombination = function(wholesale_price, price_impact, weight_impact, unit_impact, reference, packing_per_bale, ean, quantity, image, old_attr, id_product_attribute, default_attribute, eco_tax, upc, minimal_quantity, available_date) { var link = ''; self.init_elems(); $('#stock_mvt_attribute').show(); $('#initial_stock_attribute').hide(); $('#attribute_quantity').html(quantity); $('#attribute_quantity').show(); $('#attr_qty_stock').show(); $('#attribute_minimal_quantity').val(minimal_quantity); getE('attribute_reference').value = reference; getE('attribute_packing_per_bale').value = packing_per_bale; getE('attribute_ean13').value = ean; getE('attribute_upc').value = upc; getE('attribute_wholesale_price').value = Math.abs(wholesale_price); getE('attribute_price').value = ps_round(Math.abs(price_impact), 2); getE('attribute_priceTEReal').value = Math.abs(price_impact); getE('attribute_weight').value = Math.abs(weight_impact); getE('attribute_unity').value = Math.abs(unit_impact); if ($('#attribute_ecotax').length != 0) getE('attribute_ecotax').value = eco_tax; Still I am facing the same Problem. Any further suggestions? NOTE : packing_per_bale is my custom filed.
×
×
  • Create New...