Skip to content

Commit

Permalink
Merge pull request #759 from eddieferrer/cleanup_duplicate_sales_items
Browse files Browse the repository at this point in the history
remove duplicate entries from datafeeds on sales page
  • Loading branch information
eddieferrer authored Jan 4, 2024
2 parents 800258e + 4d8cff4 commit b1ed0f9
Show file tree
Hide file tree
Showing 14 changed files with 314,933 additions and 225,042 deletions.
22 changes: 22 additions & 0 deletions backend/avantlink/process_data_feeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,28 @@ def process_data_feeds(target_feed, sendDiscountItems = False, sendMissingItems
data_feed_info["Product"]["SKU"][0:3] == product["SKU"][0:3]:
productAlreadyAdded = True

# Takes care of some datafeeds which have 1 product with different names per size and skus
# for example backcountry
# TODO! duplicate items still added that have the same first 7 sku digits
# different sizes and different sale prices
if data_feed_info["Retailer_Name"] == 'Backcountry' and \
feed["retailer_name"] == 'Backcountry' and \
data_feed_info["Product"]["Sale_Price"] == product["Sale_Price"] and \
data_feed_info["Product"]["Retail_Price"] == product["Retail_Price"] and \
data_feed_info["Product"]["Brand_Name"] == product["Brand_Name"] and \
data_feed_info["Product"]["SKU"][0:7] == product["SKU"][0:7]:
productAlreadyAdded = True

# Takes care of some datafeeds which have 1 product with different names per size and skus
# for example backcountry
if data_feed_info["Retailer_Name"] == 'Black Diamond Equipment' and \
feed["retailer_name"] == 'Black Diamond Equipment' and \
data_feed_info["Product"]["Sale_Price"] == product["Sale_Price"] and \
data_feed_info["Product"]["Retail_Price"] == product["Retail_Price"] and \
data_feed_info["Product"]["Brand_Name"] == product["Brand_Name"] and \
data_feed_info["Product"]["SKU"][0:10] == product["SKU"][0:10]:
productAlreadyAdded = True

# Takes care of some datafeeds which have 1 product with different names per size and skus
# for example lasportiva
if data_feed_info["Retailer_Name"] == 'La Sportiva' and \
Expand Down
7,544 changes: 1 addition & 7,543 deletions backend/sample_datafeeds/adidas_outdoor_datafeed.xml

Large diffs are not rendered by default.

81,181 changes: 75,955 additions & 5,226 deletions backend/sample_datafeeds/backcountry_datafeed.xml

Large diffs are not rendered by default.

184 changes: 0 additions & 184 deletions backend/sample_datafeeds/bentgate_datafeed.xml
Original file line number Diff line number Diff line change
@@ -1,187 +1,3 @@
<?xml version="1.0" encoding="us-ascii"?>
<Products>
<Product>
<SKU>11043</SKU>
<Manufacturer_Id>11043</Manufacturer_Id>
<Brand_Name>La Sportiva</Brand_Name>
<Product_Name>La Sportiva Women's Miura Rock Climbing Shoe 2017</Product_Name>
<Long_Description>For climbers that demand the highest level of small foothold performance from their climbing footwear. Excels at hard rock climbing, power edging, pockets, Yosemite granite...everything. The new Women's model is chock full of new features. Features: a Full eight-panel Dentex lined upper and speed lacing system for an absolute precision fit a VibramA(R) rubber with Powerhinge and dynamic slingshot heel band that focuses power to the toe box a Offset asymmetrical toe box places power and energy under the big toe creating an inside edge sweet-spot a Women's model has a padded heel collar for supreme comfort and a breathable tongue to round out the design a COLOR: Ice a UPPER: Leather a CONSTRUCTION: Slip Lasted a LAST: WPD75 a LINING: Dentex a SOLE: 4mm VibramA(R) MIDSOLE: 1.1mm Laspoflex (forefoot only) a WEIGHT: 19oz NOTE: THIS PRODUCT SHIPS ONLY TO NORTH AMERICA</Long_Description>
<Short_Description></Short_Description>
<Category>Climbing Shoes</Category>
<SubCategory></SubCategory>
<Product_Group></Product_Group>
<Thumb_URL>http://i3.avlws.com/1725/s127291.png</Thumb_URL>
<Image_URL>http://i3.avlws.com/1725/l127291.png</Image_URL>
<Buy_Link>http://classic.avantlink.com/click.php?p=246471&amp;pw=197019&amp;pt=3&amp;pri=127291&amp;tt=df</Buy_Link>
<Keywords></Keywords>
<Reviews></Reviews>
<Retail_Price>165.00</Retail_Price>
<Sale_Price>49.99</Sale_Price>
<Brand_Page_Link></Brand_Page_Link>
<Brand_Logo_Image></Brand_Logo_Image>
<Product_Page_View_Tracking>&lt;img src=&quot;http://classic.avantlink.com/dfpv.php?p=246471&amp;amp;pri=127291&quot; width=&quot;0&quot; height=&quot;0&quot; style=&quot;border: none !important; margin: 0px !important;&quot; alt=&quot;&quot; /&gt;</Product_Page_View_Tracking>
<Product_Parent_Grouping_Id>15796</Product_Parent_Grouping_Id>
<Product_Color></Product_Color>
<Product_Size>34</Product_Size>
<Product_Pattern></Product_Pattern>
<Product_Material></Product_Material>
<Product_Weight></Product_Weight>
<Product_Age_Group>adult</Product_Age_Group>
<Product_Gender>female</Product_Gender>
<Product_UPC></Product_UPC>
<Product_GTIN>0801216072658</Product_GTIN>
<Product_GUID></Product_GUID>
<Product_Sale_Price_Effective_Date></Product_Sale_Price_Effective_Date>
<Product_Availability>in stock</Product_Availability>
<Product_Visibility></Product_Visibility>
<Product_Model_Number></Product_Model_Number>
<Product_Quantity></Product_Quantity>
<Product_Alternate_Buy_URL></Product_Alternate_Buy_URL>
<Product_Alternate_Product_ID></Product_Alternate_Product_ID>
<Product_Alternate_Image_ID></Product_Alternate_Image_ID>
<Medium_Image_URL>http://i3.avlws.com/1725/m127291.png</Medium_Image_URL>
<Product_Content_Widget>&lt;script type=&quot;text/javascript&quot; src=&quot;http://classic.avantlink.com/apcw.php?mode=5&amp;amp;pw=197019&amp;amp;df=1725&amp;amp;sku=11043&amp;amp;link=&amp;amp;tabs=-Details&quot;&gt;&lt;/script&gt;</Product_Content_Widget>
<Google_Categorization></Google_Categorization>
<Extended_Xml_Attributes>
<variants><variant><vendor_sku>La Sportiva</vendor_sku><size>34</size><retail_price>49.99</retail_price><sale_price>11043.00</sale_price><image_url>https://cdn11.bigcommerce.com/s-r7b2h7tj/products/15796/images/35723/Miura%252520W%2525201__27028.1436310999.1280.1280.jpg?c=2</image_url><detail_url>http://classic.avantlink.com/click.php?tt=cl&amp;mi=11741&amp;pw=197019&amp;url=http%3A%2F%2Fwww.bentgate.com%2Fla-sportiva-womens-miura-rock-climbing-shoe-2017%2F</detail_url></variant></variants>
</Extended_Xml_Attributes>
</Product>
<Product>
<SKU>60677</SKU>
<Manufacturer_Id>60677</Manufacturer_Id>
<Brand_Name>La Sportiva</Brand_Name>
<Product_Name>La Sportiva Women's Katana Rock Climbing Shoe</Product_Name>
<Long_Description>Lined with Pacific in the forefoot for toe knuckle comfort and Dentex in the back for moisture management, the Katana sports a LoricaA(R) toe-box to help keep the shape of the toe box and provide power while edging. The slingshot rand is connected to the powerhinge for excellent edging prowess and the opposing hook and loop closure straps provide opposing tension for a great fit. IDEAL TERRAIN: moderately overhanging sport routes, face climbing, gym climbing, crack climbing WEIGHT: 7.87 oz a 223 g LAST: Women's PD 55 FIT: Tech w/ Medium-High Asymmetry UPPER: LoricaA(R)/ Leather LINING: Pacific (forefoot)/ Dentex (back) MIDSOLE: 1.1mm full-length LaspoFlex SOLE: 4mm VibramA(R) XS Grip2</Long_Description>
<Short_Description></Short_Description>
<Category>Climbing Shoes</Category>
<SubCategory></SubCategory>
<Product_Group></Product_Group>
<Thumb_URL>http://i3.avlws.com/1725/s127301.png</Thumb_URL>
<Image_URL>http://i3.avlws.com/1725/l127301.png</Image_URL>
<Buy_Link>http://classic.avantlink.com/click.php?p=246471&amp;pw=197019&amp;pt=3&amp;pri=127301&amp;tt=df</Buy_Link>
<Keywords></Keywords>
<Reviews></Reviews>
<Retail_Price>149.95</Retail_Price>
<Sale_Price>49.99</Sale_Price>
<Brand_Page_Link></Brand_Page_Link>
<Brand_Logo_Image></Brand_Logo_Image>
<Product_Page_View_Tracking>&lt;img src=&quot;http://classic.avantlink.com/dfpv.php?p=246471&amp;amp;pri=127301&quot; width=&quot;0&quot; height=&quot;0&quot; style=&quot;border: none !important; margin: 0px !important;&quot; alt=&quot;&quot; /&gt;</Product_Page_View_Tracking>
<Product_Parent_Grouping_Id>17055</Product_Parent_Grouping_Id>
<Product_Color></Product_Color>
<Product_Size>34</Product_Size>
<Product_Pattern></Product_Pattern>
<Product_Material></Product_Material>
<Product_Weight></Product_Weight>
<Product_Age_Group>adult</Product_Age_Group>
<Product_Gender>female</Product_Gender>
<Product_UPC></Product_UPC>
<Product_GTIN>0801216167675</Product_GTIN>
<Product_GUID></Product_GUID>
<Product_Sale_Price_Effective_Date></Product_Sale_Price_Effective_Date>
<Product_Availability>in stock</Product_Availability>
<Product_Visibility></Product_Visibility>
<Product_Model_Number></Product_Model_Number>
<Product_Quantity></Product_Quantity>
<Product_Alternate_Buy_URL></Product_Alternate_Buy_URL>
<Product_Alternate_Product_ID></Product_Alternate_Product_ID>
<Product_Alternate_Image_ID></Product_Alternate_Image_ID>
<Medium_Image_URL>http://i3.avlws.com/1725/m127301.png</Medium_Image_URL>
<Product_Content_Widget>&lt;script type=&quot;text/javascript&quot; src=&quot;http://classic.avantlink.com/apcw.php?mode=5&amp;amp;pw=197019&amp;amp;df=1725&amp;amp;sku=60677&amp;amp;link=&amp;amp;tabs=-Details&quot;&gt;&lt;/script&gt;</Product_Content_Widget>
<Google_Categorization></Google_Categorization>
<Extended_Xml_Attributes>
<variants><variant><vendor_sku>La Sportiva</vendor_sku><size>34</size><retail_price>49.99</retail_price><sale_price>60677.00</sale_price><image_url>https://cdn11.bigcommerce.com/s-r7b2h7tj/products/17055/images/42040/9896-PINK-l__51792.1436552365.1280.1280.jpg?c=2</image_url><detail_url>http://classic.avantlink.com/click.php?tt=cl&amp;mi=11741&amp;pw=197019&amp;url=http%3A%2F%2Fwww.bentgate.com%2Fla-sportiva-womens-katana-rock-climbing-shoe%2F</detail_url></variant></variants>
</Extended_Xml_Attributes>
</Product>
<Product>
<SKU>67060</SKU>
<Manufacturer_Id>67060</Manufacturer_Id>
<Brand_Name>Scarpa</Brand_Name>
<Product_Name>Scarpa Booster S Climbing Shoe</Product_Name>
<Long_Description>Sensitive yet supportive, powerful yet precise, the versatile Booster S is a superlative shoe for steep, demanding terrain that pairs the aggressively downturned, asymmetric shape of our Specialized Performance series with a lightweight construction. SIZE OPTIONS : 34 - 45 (half sizes) WEIGHT REFERENCE : 210g; 7.4oz (1/2 pair size 42) UPPER : Microsuede MIDSOLE : Flexan 1.0mm LAST : FZ - Aggressive, Downturned and Highly Asymmetric PROFILE : Aggressively Downturned SYMMETRY : Highly Asymmetric CLOSURE : Strap PRIMARY MATERIAL : Synthetic SOLE RUBBER : VibramA(R) XS Grip2</Long_Description>
<Short_Description></Short_Description>
<Category>Climbing Shoes</Category>
<SubCategory></SubCategory>
<Product_Group></Product_Group>
<Thumb_URL>http://i3.avlws.com/1725/s127285.png</Thumb_URL>
<Image_URL>http://i3.avlws.com/1725/l127285.png</Image_URL>
<Buy_Link>http://classic.avantlink.com/click.php?p=246471&amp;pw=197019&amp;pt=3&amp;pri=127285&amp;tt=df</Buy_Link>
<Keywords></Keywords>
<Reviews></Reviews>
<Retail_Price>180.00</Retail_Price>
<Sale_Price>99.99</Sale_Price>
<Brand_Page_Link></Brand_Page_Link>
<Brand_Logo_Image></Brand_Logo_Image>
<Product_Page_View_Tracking>&lt;img src=&quot;http://classic.avantlink.com/dfpv.php?p=246471&amp;amp;pri=127285&quot; width=&quot;0&quot; height=&quot;0&quot; style=&quot;border: none !important; margin: 0px !important;&quot; alt=&quot;&quot; /&gt;</Product_Page_View_Tracking>
<Product_Parent_Grouping_Id>23451</Product_Parent_Grouping_Id>
<Product_Color></Product_Color>
<Product_Size>37</Product_Size>
<Product_Pattern></Product_Pattern>
<Product_Material></Product_Material>
<Product_Weight></Product_Weight>
<Product_Age_Group>adult</Product_Age_Group>
<Product_Gender>male</Product_Gender>
<Product_UPC></Product_UPC>
<Product_GTIN>0666898488322</Product_GTIN>
<Product_GUID></Product_GUID>
<Product_Sale_Price_Effective_Date></Product_Sale_Price_Effective_Date>
<Product_Availability>in stock</Product_Availability>
<Product_Visibility></Product_Visibility>
<Product_Model_Number></Product_Model_Number>
<Product_Quantity></Product_Quantity>
<Product_Alternate_Buy_URL></Product_Alternate_Buy_URL>
<Product_Alternate_Product_ID></Product_Alternate_Product_ID>
<Product_Alternate_Image_ID></Product_Alternate_Image_ID>
<Medium_Image_URL>http://i3.avlws.com/1725/m127285.png</Medium_Image_URL>
<Product_Content_Widget>&lt;script type=&quot;text/javascript&quot; src=&quot;http://classic.avantlink.com/apcw.php?mode=5&amp;amp;pw=197019&amp;amp;df=1725&amp;amp;sku=67060&amp;amp;link=&amp;amp;tabs=-Details&quot;&gt;&lt;/script&gt;</Product_Content_Widget>
<Google_Categorization></Google_Categorization>
<Extended_Xml_Attributes>
<variants><variant><vendor_sku>Scarpa</vendor_sku><size>37</size><retail_price>99.99</retail_price><sale_price>67060.00</sale_price><image_url>https://cdn11.bigcommerce.com/s-r7b2h7tj/products/23451/images/58473/scarpa-BOOSTER-S-otherside-bentgate__82024.1525721008.1280.1280.jpg?c=2</image_url><detail_url>http://classic.avantlink.com/click.php?tt=cl&amp;mi=11741&amp;pw=197019&amp;url=http%3A%2F%2Fwww.bentgate.com%2Fscarpa-booster-s-climbing-shoe%2F</detail_url></variant></variants>
</Extended_Xml_Attributes>
</Product>
<Product>
<SKU>74542</SKU>
<Manufacturer_Id>74542</Manufacturer_Id>
<Brand_Name>Scarpa</Brand_Name>
<Product_Name>Scarpa Women's Vapor V Rock Climbing Shoe</Product_Name>
<Long_Description>Precise, versatile, and a best seller - the Vapor V opens 5.15 performance to the masses, with an asymmetric and slightly downturned fit and Bi-Tension randing. Rather than jam toes forward, the rand connects beneath the toes and pulls backwards to the heel structure, the opposite of slingshot randing. The result? Power and precision, married to a stretch-gusseted airmesh tongue for comfort and VibramA(R) XS Edge rubber. Sticky, energized, comfortable shoes for anything steep, indoors or out. Specs: a Upper: Suede/Microsuede a Midsole: Flexan a Sole: VibramA(R) XS Edge; 4mm a Last: FR a Weight: 207g; 7.3oz (1/2 pair size 38)</Long_Description>
<Short_Description></Short_Description>
<Category>Climbing Shoes</Category>
<SubCategory></SubCategory>
<Product_Group></Product_Group>
<Thumb_URL>http://i3.avlws.com/1725/s127293.png</Thumb_URL>
<Image_URL>http://i3.avlws.com/1725/l127293.png</Image_URL>
<Buy_Link>http://classic.avantlink.com/click.php?p=246471&amp;pw=197019&amp;pt=3&amp;pri=127293&amp;tt=df</Buy_Link>
<Keywords></Keywords>
<Reviews></Reviews>
<Retail_Price>164.95</Retail_Price>
<Sale_Price>49.99</Sale_Price>
<Brand_Page_Link></Brand_Page_Link>
<Brand_Logo_Image></Brand_Logo_Image>
<Product_Page_View_Tracking>&lt;img src=&quot;http://classic.avantlink.com/dfpv.php?p=246471&amp;amp;pri=127293&quot; width=&quot;0&quot; height=&quot;0&quot; style=&quot;border: none !important; margin: 0px !important;&quot; alt=&quot;&quot; /&gt;</Product_Page_View_Tracking>
<Product_Parent_Grouping_Id>17119</Product_Parent_Grouping_Id>
<Product_Color></Product_Color>
<Product_Size>34</Product_Size>
<Product_Pattern></Product_Pattern>
<Product_Material></Product_Material>
<Product_Weight></Product_Weight>
<Product_Age_Group>adult</Product_Age_Group>
<Product_Gender>female</Product_Gender>
<Product_UPC></Product_UPC>
<Product_GTIN>0666898528127</Product_GTIN>
<Product_GUID></Product_GUID>
<Product_Sale_Price_Effective_Date></Product_Sale_Price_Effective_Date>
<Product_Availability>in stock</Product_Availability>
<Product_Visibility></Product_Visibility>
<Product_Model_Number></Product_Model_Number>
<Product_Quantity></Product_Quantity>
<Product_Alternate_Buy_URL></Product_Alternate_Buy_URL>
<Product_Alternate_Product_ID></Product_Alternate_Product_ID>
<Product_Alternate_Image_ID></Product_Alternate_Image_ID>
<Medium_Image_URL>http://i3.avlws.com/1725/m127293.png</Medium_Image_URL>
<Product_Content_Widget>&lt;script type=&quot;text/javascript&quot; src=&quot;http://classic.avantlink.com/apcw.php?mode=5&amp;amp;pw=197019&amp;amp;df=1725&amp;amp;sku=74542&amp;amp;link=&amp;amp;tabs=-Details&quot;&gt;&lt;/script&gt;</Product_Content_Widget>
<Google_Categorization></Google_Categorization>
<Extended_Xml_Attributes>
<variants><variant><vendor_sku>Scarpa</vendor_sku><size>34</size><retail_price>49.99</retail_price><sale_price>74542.00</sale_price><image_url>https://cdn11.bigcommerce.com/s-r7b2h7tj/products/17119/images/50346/Scarpa-Womens-Vapor-V-Rock-Climbing-Shoe-Bentgate__47056.1464113854.1280.1280.jpg?c=2</image_url><detail_url>http://classic.avantlink.com/click.php?tt=cl&amp;mi=11741&amp;pw=197019&amp;url=http%3A%2F%2Fwww.bentgate.com%2Fscarpa-womens-vapor-v-rock-climbing-shoe%2F</detail_url></variant></variants>
</Extended_Xml_Attributes>
</Product>
</Products>
Loading

0 comments on commit b1ed0f9

Please sign in to comment.