Skip to content

Commit e440d44

Browse files
committed
Resolves smartstore#582 GMC feed: Option to include\exclude a product
1 parent 82b26cd commit e440d44

15 files changed

Lines changed: 264 additions & 19 deletions

changelog.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
# Release Notes
1+
# Release Notes
2+
3+
## SmartStore.NET 2.5
4+
5+
### New Features
6+
* #582 GMC feed: Option to include\exclude a product
27

38
## SmartStore.NET 2.2
49

src/Plugins/SmartStore.GoogleMerchantCenter/Controllers/FeedFroogleController.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ public ActionResult ProductEditTab(int productId)
5555
model.Size = entity.Size;
5656
model.Material = entity.Material;
5757
model.Pattern = entity.Pattern;
58+
model.Exporting = entity.Export;
5859
}
5960

6061
ViewBag.DefaultCategory = _settings.DefaultGoogleCategory;

src/Plugins/SmartStore.GoogleMerchantCenter/Data/Migrations/201504211854125_IsActive.Designer.cs

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
namespace SmartStore.GoogleMerchantCenter.Data.Migrations
2+
{
3+
using System;
4+
using System.Data.Entity.Migrations;
5+
6+
public partial class IsActive : DbMigration
7+
{
8+
public override void Up()
9+
{
10+
AddColumn("dbo.GoogleProduct", "Export", c => c.Boolean(nullable: false, defaultValue: true));
11+
}
12+
13+
public override void Down()
14+
{
15+
DropColumn("dbo.GoogleProduct", "Export");
16+
}
17+
}
18+
}
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<root>
3+
<!--
4+
Microsoft ResX Schema
5+
6+
Version 2.0
7+
8+
The primary goals of this format is to allow a simple XML format
9+
that is mostly human readable. The generation and parsing of the
10+
various data types are done through the TypeConverter classes
11+
associated with the data types.
12+
13+
Example:
14+
15+
... ado.net/XML headers & schema ...
16+
<resheader name="resmimetype">text/microsoft-resx</resheader>
17+
<resheader name="version">2.0</resheader>
18+
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19+
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20+
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21+
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22+
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23+
<value>[base64 mime encoded serialized .NET Framework object]</value>
24+
</data>
25+
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26+
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27+
<comment>This is a comment</comment>
28+
</data>
29+
30+
There are any number of "resheader" rows that contain simple
31+
name/value pairs.
32+
33+
Each data row contains a name, and value. The row also contains a
34+
type or mimetype. Type corresponds to a .NET class that support
35+
text/value conversion through the TypeConverter architecture.
36+
Classes that don't support this are serialized and stored with the
37+
mimetype set.
38+
39+
The mimetype is used for serialized objects, and tells the
40+
ResXResourceReader how to depersist the object. This is currently not
41+
extensible. For a given mimetype the value must be set accordingly:
42+
43+
Note - application/x-microsoft.net.object.binary.base64 is the format
44+
that the ResXResourceWriter will generate, however the reader can
45+
read any of the formats listed below.
46+
47+
mimetype: application/x-microsoft.net.object.binary.base64
48+
value : The object must be serialized with
49+
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50+
: and then encoded with base64 encoding.
51+
52+
mimetype: application/x-microsoft.net.object.soap.base64
53+
value : The object must be serialized with
54+
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55+
: and then encoded with base64 encoding.
56+
57+
mimetype: application/x-microsoft.net.object.bytearray.base64
58+
value : The object must be serialized into a byte array
59+
: using a System.ComponentModel.TypeConverter
60+
: and then encoded with base64 encoding.
61+
-->
62+
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63+
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64+
<xsd:element name="root" msdata:IsDataSet="true">
65+
<xsd:complexType>
66+
<xsd:choice maxOccurs="unbounded">
67+
<xsd:element name="metadata">
68+
<xsd:complexType>
69+
<xsd:sequence>
70+
<xsd:element name="value" type="xsd:string" minOccurs="0" />
71+
</xsd:sequence>
72+
<xsd:attribute name="name" use="required" type="xsd:string" />
73+
<xsd:attribute name="type" type="xsd:string" />
74+
<xsd:attribute name="mimetype" type="xsd:string" />
75+
<xsd:attribute ref="xml:space" />
76+
</xsd:complexType>
77+
</xsd:element>
78+
<xsd:element name="assembly">
79+
<xsd:complexType>
80+
<xsd:attribute name="alias" type="xsd:string" />
81+
<xsd:attribute name="name" type="xsd:string" />
82+
</xsd:complexType>
83+
</xsd:element>
84+
<xsd:element name="data">
85+
<xsd:complexType>
86+
<xsd:sequence>
87+
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88+
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89+
</xsd:sequence>
90+
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91+
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92+
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93+
<xsd:attribute ref="xml:space" />
94+
</xsd:complexType>
95+
</xsd:element>
96+
<xsd:element name="resheader">
97+
<xsd:complexType>
98+
<xsd:sequence>
99+
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100+
</xsd:sequence>
101+
<xsd:attribute name="name" type="xsd:string" use="required" />
102+
</xsd:complexType>
103+
</xsd:element>
104+
</xsd:choice>
105+
</xsd:complexType>
106+
</xsd:element>
107+
</xsd:schema>
108+
<resheader name="resmimetype">
109+
<value>text/microsoft-resx</value>
110+
</resheader>
111+
<resheader name="version">
112+
<value>2.0</value>
113+
</resheader>
114+
<resheader name="reader">
115+
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116+
</resheader>
117+
<resheader name="writer">
118+
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119+
</resheader>
120+
<data name="Target" xml:space="preserve">
121+
<value>H4sIAAAAAAAEAM1ZzW7jNhC+F+g7CDq1QNZynEsbyLvIOj8Iuo6DyNk7LY0dthSpklRg76v10EfqK+xQ/5JlW4rjRW/2iPPNHzXfjP3fP/+6n9Yhs15BKir42D4fDG0LuC8CyldjO9bLD7/Znz7+/JN7E4Rr62t+7sKcQ02uxvaL1tGl4yj/BUKiBiH1pVBiqQe+CB0SCGc0HP7unJ87gBA2YlmW+xRzTUNIvuDXieA+RDombCoCYCqT4xMvQbUeSAgqIj6MbS8kUntaSBjcCbFiMAXpvxCuJ8A1yME10cS2rhgl6JsHbGlbhHOhiUbPL58VeFoKvvIiFBA230SA55aEKcgiuiyPdw1uODLBOaViDuXHSouwJ+D5RZYtp6n+ppzbRTYxnzeYd70xUSc5HdtpDh+lCGJfP4EvZGBbTbuXEyaNTofsoxrlgxbUM+uA7llxvUaD0WA4GJ5Zk5jpWMKYQ6wlYWfWY7xg1P8DNnPxF/AxjxmrhocB4rOaAEXoRgRSb55gmQV9jzE6dT2nqVioVXTSHNxzfTGyrQc0ThYMittTyVcS5R1wkERD8Eg0xscNBiT537LesJUl7rDJ/TBzshZchJscBW8+vta2NSXrL8BX+mVs40fbuqVrCHJJhvzMKXYBVNIyPmgIIw1AntzM1QrupIijkxuaCCZOH45Hv8HJjUzxAkpsdCc3lF3yk9u51xAmt6B8O05nS81FjD22sPRZCAaE934TJxJMI5jxZ+3nWEhUMEcS7A32HAXvB3azjoTU/eJznZJGtskFyVwjB4BsY5jZ4k/wtTkCa91CNMjPGdeorER171MTHujd9KVsq3QvHQHa+Kg9pML5cgRx0hkkn1WcHcOKOyVRhNewMrxkEstLJ5fJB68/gYcphuOrFh4vvC0sIe+QFTSemoYWwC2VSpvpaEFMQSdBuHVsT6l2lCE3vKcaTToui5Mrm89ZS+ww3LUWs2GkTP4t5iNE5SQ1UPjdPvhsoSQTKGFEtgwDSBJxyHcNFPu0K/ReBamIu2OVHF+FKqXdkXISr+Lksu4oJUdXcUppd6SMhKswmag7RkqxVYhU0h2h5M8qSintUfWcIGs1z4XdcWoEWLuE1Qc98EqSq6GV4h41q/FcrXS1J90R62RXRaw/6Y6YM14VK5dto7hOo5E025mz1c8ai0WzV+5jneaRwnrBPg2WcbOOf3hv3qKA9IhtYXpeaWDav7dReIXSJuv9zSaMYrzlgSnhdAlKp7uXjYvqqLFo/3+WXkepgPXffH/4LklNgg9uiz1nuq31MbFy5PLIX4mhYvlLSNa/VtH6L4hHQTWXwKPAaoveUUjVZe4ooObCdhRYYyk7Cqtl8ToOr7lcLWj/W9q2WBla0O+1WL0ZrL5YHY6t31K1PdD33pO6rkkpT2AmFgKjSf2vHXzzJrXNXa5T/WXYvQZFVyWE+Z2Y406CpFCC5mfu+VLkJcC4qx7lR5pvGmiC5SVXUtMl8TU+9kGp5KeEr4TFpojhAoJ7Pot1FOsrpSBcsNpQ7Tr77SfrYt1ndxaZb+o9QkA3qbmhM/45piwo/L5tuV87IMxNyrgHvfK04aDVpkB6ELwjUJa+a4hMs+d6DmHEEEzNuEde4S2+PSv4Aivib/IRZDfI4ULU0+5eU7KSJFQZRqlv/u1wzN8dH78D4O1TvSAZAAA=</value>
122+
</data>
123+
<data name="DefaultSchema" xml:space="preserve">
124+
<value>dbo</value>
125+
</data>
126+
</root>

src/Plugins/SmartStore.GoogleMerchantCenter/Description.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FriendlyName: Google Merchant Center (GMC)
22
SystemName: SmartStore.GoogleMerchantCenter
33
Group: Marketing
4-
Version: 2.2.0
4+
Version: 2.2.0.1
55
MinAppVersion: 2.2.0
66
Author: SmartStore AG
77
DisplayOrder: 1

src/Plugins/SmartStore.GoogleMerchantCenter/Domain/GoogleProductRecord.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,7 @@ public partial class GoogleProductRecord : BaseEntity
2222
public bool IsTouched { get; set; }
2323
public DateTime CreatedOnUtc { get; set; }
2424
public DateTime UpdatedOnUtc { get; set; }
25+
26+
public bool Export { get; set; }
2527
}
2628
}

src/Plugins/SmartStore.GoogleMerchantCenter/Events.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public void HandleEvent(ModelBoundEvent eventMessage)
4848

4949
if (entity == null)
5050
{
51-
entity = new GoogleProductRecord()
51+
entity = new GoogleProductRecord
5252
{
5353
ProductId = model.ProductId,
5454
CreatedOnUtc = utcNow
@@ -63,6 +63,7 @@ public void HandleEvent(ModelBoundEvent eventMessage)
6363
entity.Taxonomy = model.Taxonomy;
6464
entity.Material = model.Material;
6565
entity.Pattern = model.Pattern;
66+
entity.Export = model.Exporting;
6667
entity.UpdatedOnUtc = utcNow;
6768

6869
entity.IsTouched = entity.IsTouched();

src/Plugins/SmartStore.GoogleMerchantCenter/Extensions/MiscExtensions.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public static string XEditableLink(this HtmlHelper hlp, string fieldName, string
99
{
1010
string displayText = null;
1111

12-
if (fieldName == "Gender" || fieldName == "AgeGroup")
12+
if (fieldName == "Gender" || fieldName == "AgeGroup" || fieldName == "Exporting")
1313
displayText = "<#= {0}Localize #>".FormatWith(fieldName);
1414
else
1515
displayText = "<#= {0} #>".FormatWith(fieldName);
@@ -27,7 +27,8 @@ public static bool IsTouched(this GoogleProductRecord product)
2727
if (product != null)
2828
{
2929
return product.Taxonomy.HasValue() || product.Gender.HasValue() || product.AgeGroup.HasValue() || product.Color.HasValue() ||
30-
product.Size.HasValue() || product.Material.HasValue() || product.Pattern.HasValue() || product.ItemGroupId.HasValue();
30+
product.Size.HasValue() || product.Material.HasValue() || product.Pattern.HasValue() || product.ItemGroupId.HasValue() ||
31+
!product.Export;
3132
}
3233
return false;
3334
}

src/Plugins/SmartStore.GoogleMerchantCenter/Models/FeedFroogleModel.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,17 @@ public string ProductTypeLabelHint
252252
[SmartResourceDisplayName("Plugins.Feed.Froogle.Products.Pattern")]
253253
public string Pattern { get; set; }
254254

255+
[SmartResourceDisplayName("Common.Export")]
256+
public int Export { get; set; }
257+
[SmartResourceDisplayName("Common.Export")]
258+
public bool Exporting
259+
{
260+
get { return Export != 0; }
261+
set { Export = (value ? 1 : 0); }
262+
}
263+
255264
public string GenderLocalize { get; set; }
256265
public string AgeGroupLocalize { get; set; }
266+
public string ExportingLocalize { get; set; }
257267
}
258268
}

0 commit comments

Comments
 (0)