Skip to content

Commit

Permalink
Added google_product_type in the product object and added in the data…
Browse files Browse the repository at this point in the history
…feed xml
  • Loading branch information
rasseljandavid committed Jul 21, 2011
1 parent 95dc84c commit fd11044
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
14 changes: 9 additions & 5 deletions cron/generateXMLFeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
//print "\n" . $prodCount . "\n";
//print "\n";

$products = $db->selectObjectsBySql('SELECT DISTINCT(p.id),active_type,availability_type,quantity, model,feed_title,feed_body,sef_url,base_price,use_special_price, special_price,f.directory,f.filename, c.title as company FROM exponent_product p
$products = $db->selectObjectsBySql('SELECT DISTINCT(p.id),active_type,availability_type,quantity, model,feed_title,feed_body,google_product_type,sef_url,base_price,use_special_price, special_price,f.directory,f.filename, c.title as company FROM exponent_product p
LEFT JOIN exponent_content_expFiles cf ON
p.id = cf.content_id
LEFT JOIN exponent_expFiles f ON
Expand Down Expand Up @@ -69,13 +69,13 @@

foreach ($prodflipper as $p2)
{
$prodflipper2[$p2->sef_url] = $p2;
@$prodflipper2[$p2->sef_url] = $p2;
}
echo "Flip Count 2: " . count($prodflipper2). "\r\n";;

foreach ($prodflipper2 as $p3)
{
$prodflipper3[$p3->model] = $p3;
@$prodflipper3[$p3->model] = $p3;
}
echo "Flip Count 3: " . count($prodflipper3). "\r\n";;

Expand Down Expand Up @@ -113,6 +113,10 @@
$prod->feed_title = parseAndTrim(html_entity_decode(strip_tags($prod->feed_title)));
$prod->feed_title = htmlspecialchars($prod->feed_title);
$prod->feed_title = onlyreadables($prod->feed_title);

$prod->google_product_type = parseAndTrim(html_entity_decode(strip_tags($prod->google_product_type)));
$prod->google_product_type = htmlspecialchars($prod->google_product_type);
$prod->google_product_type = onlyreadables($prod->google_product_type);
//if(ctype_upper($prod->feed_title))
//{
//$prod->feed_title = ucwords(strtolower($prod->feed_title));
Expand Down Expand Up @@ -193,9 +197,9 @@
$columns.='<g:quantity>0</g:quantity>'.chr(13).chr(10);
}

if(!empty($google_types)) {
if(!empty($prod->google_product_type)) {
$columns.='<g:product_type>';
$columns.= parseAndTrim($google_types);
$columns.= parseAndTrim($prod->google_product_type);
$columns.='</g:product_type>'.chr(13).chr(10);
}
//$breadcrumb = $prod->storeCategory[0]->getEcomSubcategories();
Expand Down
4 changes: 4 additions & 0 deletions framework/core/database/definitions/product.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
DB_INDEX=>10,
DB_FULLTEXT=>true),
"feed_title"=>array(
DB_FIELD_TYPE=>DB_DEF_STRING,
DB_FIELD_LEN=>100,
DB_INDEX=>10),
"google_product_type"=>array(
DB_FIELD_TYPE=>DB_DEF_STRING,
DB_FIELD_LEN=>100,
DB_INDEX=>10),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
{control type="editor" name="body" label="Product Description" height=450 value=$record->body}
{control type="text" class="title" name="feed_title" label="Product Title for Data Feeds" value=$record->feed_title}
{control type="textarea" name="feed_body" label="Product Description for Data Feeds (Description ONLY! - no HTML, no promotional language, no email addresses, phone numbers, or references to this website.)" rows=5 cols=85 value=$record->feed_body}

{control type="text" class="title" name="google_product_type" label="Google Product Type" value=$record->google_product_type}
</div>
<div id="pricing">
<fieldset>
Expand Down

0 comments on commit fd11044

Please sign in to comment.