1. zakgr
  2. RO CSVI
  3. Thursday, 10 June 2021
  4.  Subscribe via email
Hi

I have an xml file that looks like the below

<NewDataSet>
<Table>
<Product_ID>89281</Product_ID>
<Product_Partnumber>Α-00016450</Product_Partnumber>
<Category_Level>2</Category_Level>
<Omada>Εξωτερικός Χώρος</Omada>
<Category_ParentOption_ID>2.1</Category_ParentOption_ID>
<Category_Level2_Title>Εξωτερικός Χώρος</Category_Level2_Title>
<Category_ID>2.1.6</Category_ID>
<Category_Caption_Title>Μαξιλάρια - Πανιά</Category_Caption_Title>
<Product_Code>Α776</Product_Code>
<ProductCaption_Title>ZENITH Ανταλλακτικό Ύφασμα Εκρού</ProductCaption_Title>
<Product_Caption_SmallDescription>ZENITH Ανταλλακτικό Ύφασμα Εκρού</Product_Caption_SmallDescription>
<ProductCaption_LargeDescription>
Α776 ZENITH Εκρού Ύφασμα Ανταλ/κό<br> <br> ZENITH Εκρού Ύφασμα<br> <br> Ανταλλακτικό <br> <br> Για την Πολυθρόνα : <br> Ε776 ZENITH Οξυά Καρυδί<br> <br> Ύφασμα <br> Χρώμα Εκρού <br> <br> Προέλευση : EU
</ProductCaption_LargeDescription>
<Choice_Item_Description>["Εξαρτήματα-Ανταλλακτικά-Αναλώσιμα"]</Choice_Item_Description>
<Item_color_Description>["Εκρού"]</Item_color_Description>
<Stuff_Item_Description>["Ύφασμα"]</Stuff_Item_Description>
<Messages/>
<Related_Item/>
<Barcode_Item>5203547164500</Barcode_Item>
<Image1>
https://www.woodwell.gr/uploads/images/89281/zenith-ekrou-yfasma-antal-ko-enlarge.jpg
</Image1>
<Image2>
https://www.woodwell.gr/uploads/resources/24334/a-00016450.jpg
</Image2>
<Image3/>
<Image4/>
<Image5/>
<Image6/>
<Image7/>
<Image8/>
<Image9/>
<Image10/>
<Info>BAZAAR</Info>
<WholesalePrice>3.000000000</WholesalePrice>
<RetailPrice>4.00000</RetailPrice>
<CatalogPage/>
<Dimensions/>
<Weight_PC>8.20000</Weight_PC>
<Product_Weight/>
<Cum_PC>0.00100</Cum_PC>
<ExpectedDate/>
<Package>1.00000</Package>
<KibotioDimensions/>
<Packages_pcs/>
<MUnit>Τεμάχια</MUnit>
<ShowRoomStock>1</ShowRoomStock>
<Availability>1</Availability>



I would like to take the Availability filed, divide it with Package fild and put it to my virtuamrt product in stock field



I made an import template
fileds:

product_mpn Product_Partnumber
product_availability Availability

and then I created a combine rule
Source fields Availability,Package
Target field product_in_stock
operation calculation
Perform operation division

If I do not put the rule, the import updates the product_in_stock and makes it equal to the Availability field (i am taking from xml) without the division of course
If I put the rule the product_in_stock is blank

What I am making wrong?
Accepted Answer Pending Moderation
I uploaded the log file
Attachments (1)
  1. more than a month ago
  2. RO CSVI
  3. # 1
Accepted Answer Pending Moderation
Hi
I managed to make it using the combine value
I have one problem though

When I make the divide (Availability/package) everything is going ok except one occasion
when availability is lets say 0 and package 1 0/1=0
The system is giving me 1 as a result
why?
  1. more than a month ago
  2. RO CSVI
  3. # 2
Accepted Answer Pending Moderation
Hello,
I was able to see the issue with 0 divided by 1. RO CSVI checks if there is a value set and uses it for division and that check ignores 0. I have fixed it with the attached patch file. Please load the patch file and check the import again.
Attachments (1)
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 3
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!