google - froogle - add extra tags - product_type

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 năm cách đây
Hi NopC community,

NopC v1.8 (also applies to v1.9) - vs2010 professional, sql2008 express

What I am trying to do - 1. Add in g:product_type - using the categoryID and a String.   2. Display the Brand g:brand by using the name in the Manufacturer to the String....

Have written some code - see below; but the underline bit - is where i might need help - the GET info from Database Nop_Category and Nop_Manufacturer..... I think i am missing a bit of code where NopC gets this... any help would be great...!

Looking at expanding the code for Froogle - Merchant Centre (Google Shopping, Google Base...)

File:
Libraries/Nop.Froogle/FroogleService.cs


1. Brand... code

writer.WriteElementString("g", "brand", googleBaseNamespace, manufacturer.ManufacturerId.Name.ToString());


2. Category... code

writer.WriteElementString("g", "product_type", googleBaseNamespace, categoryID.ToString;
if (categoryID = 53){Console.WriteLine ("Health & Beauty > Personal Care > Cosmetics > Cosmetic Tools");}

cheers
Simon
13 năm cách đây
// Set number of Quantity of products....
writer.WriteElementString("g", "quantity", googleBaseNamespace, "25");

--------------- or add this code  --------------------

// Grabs the current Quantity of products....
writer.WriteElementString("g", "quantity", googleBaseNamespace, productVariant.StockQuantity.ToString(new CultureInfo("en-US",false).NumberFormat));

-------------------- Static - One Brand for all ---------------------

// Results in a <g:brand>Your Brand</g:brand>
// writer.WriteElementString("g", "brand", googleBaseNamespace, "Your Brand");


------------------  Or dynamic version  ------------------

// Add a reference - helps to find Manufacturers from database
using NopSolutions.NopCommerce.BusinessLogic.Manufacturers;

// Add code to the <g:Brand> area - after <g:Description>
Manufacturer mamfact = new Manufacturer();

string manufacturerName = product.ProductManufacturers.Count > 0 ? product.ProductManufacturers[0].Manufacturer.Name : String.Empty;
// above is all one line...

writer.WriteElementString("g", "brand", googleBaseNamespace, manufacturerName);
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.