Reading private sku information from CG Ecom Base

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
patrickpowerlight
New Member
New Member
Posts: 4
Joined: Tue Mar 15, 2011 5:58 pm

Reading private sku information from CG Ecom Base

Post by patrickpowerlight »

I'm trying to build a concatenated sku consisting of the product sku plus each of the attribute skus.

I've found where the line item summary is built in the supplier module and can successfully read the attribute skus into smarty variables, but the parent sku is private and I can't find a method to read into smarty.

The Error I get is:
Fatal error: Cannot access private property cg_ecomm_productinfo::$_sku in /home/content/78/8203678/html/tmp/templates_c/CGEcommerceBase^%%18^184^1848908B%%module_db_tpl%3ACGEcommerceBase%3Blineitem_desc_template.php on line 7


Here's the values coming from {$product_obj|print_r}
=========================================
cg_ecomm_productinfo Object ( [_product_id:private] => 1 [_weight:private] => 100 [_sku:private] => VI-MPK-PET [_price:private] => 0 [_name:private] => M-pack [_taxable:private] => 1 [_type:private] => 1 [_subscription:private] => [_attributes:private] => Array ( [0] => cg_ecomm_productinfo_attribute Object ( [_id:private] => 4 [_name:private] => Color [_options:private] => Array ( [0] => cg_ecomm_productinfo_attrib_option Object ( [_id:private] => 134 [_text:private] => Clear [_adjustment:private] => 0 [_sku:private] => CL ) [1] => cg_ecomm_productinfo_attrib_option Object ( [_id:private] => 135 [_text:private] => White [_adjustment:private] => 0 [_sku:private] => WH ) [2] => cg_ecomm_productinfo_attrib_option Object ( [_id:private] => 136 [_text:private] => Amber [_adjustment:private] => 0 [_sku:private] => AM ) ) ) [1] => cg_ecomm_productinfo_attribute Object ( [_id:private] => 8 [_name:private] => Dram [_options:private] => Array ( [0] => cg_ecomm_productinfo_attrib_option Object ( [_id:private] => 133 [_text:private] => Size-90 Day [_adjustment:private] => 20 [_sku:private] => 90 ) ) ) ) [_dimensions:private] => ) 1


Calguys Ecommerce Base Supplier Modules-Line Item Description Template:
---------------------------------------------
{* product summary template *}
{* used for summarizing products in view cart form page *}
{strip}
{if isset($product_obj)}
{$product_obj->get_name()} 
{foreach from=$meta->attributes item='attrib'}
{$attrib->name} {if $attrib->adjustment != 0}{$currencysymbol}({$attrib->adjustment|number_format:2}){/if} 
<h3>{$product_obj|print_r}</h3>

<h2>Template Vars</h2>
<p> {get_template_vars}</p>
{assign var="parent" value=$product_obj->_sku}
<p>Parent {$parent}</p>
{/foreach}


{assign var="get_0" value=$meta->attributes.0->sku}
{assign var="get_1" value=$meta->attributes.1->sku}
{assign var="newsku" value="$parent-$get_0-$get_1"}
<h3>NewskuValue {$newsku} End Sku</h3>

{/if}
{/strip}

----------------------------------------------

Cms Version: 1.10.3

Installed Modules:

CGExtensions: 1.27.9
CGSimpleSmarty: 1.4.10
CMSMailer: 2.0.2
CMSPrinting: 1.0
FileManager: 1.2.0
MenuManager: 1.7.7
MicroTiny: 1.1.1
ModuleManager: 1.5.3
News: 2.12.3
Printing: 1.1.2
Search: 1.7
SiteMapMadeSimple: 1.2.5
ThemeManager: 1.1.4
TinyMCE: 2.9.6
nuSOAP: 1.0.2
FormBuilder: 0.7.1
FrontEndUsers: 1.17
PHPMyAdmin: 3.4.0b3
SelfRegistration: 1.6.14
Products: 2.16.2
Cart: 1.8.1
CGPaymentGatewayBase: 1.0.11
CGEcommerceBase: 1.3.9
Orders: 1.13
JQueryTools: 1.0.10
DTInventory: 0.6
ShopMadeSimple: 0.3.8
CartMadeSimple: 0.4.2
Captcha: 0.4.5
CGUserDirectory: 1.3
FEULabels: 1.1
Statistics: 1.1.3
Promotions: 1.0.15
CustomContent: 1.7.3
FRShipping: 1.2.3
CGMyOrders: 1.0
PaymentMadeSimple: 1.5
DebugSwitch: 0.0.2
MetaMax: 1.6.6
ImageCompressor: 0.10
SkuCreator: 0.1

Config Information:

php_memory_limit:
process_whole_template: false
output_compression: false
max_upload_size: 8000000
default_upload_permission: 664
url_rewriting: mod_rewrite
page_extension:
query_var: page
image_manipulation_prog: GD
auto_alias_content: true
locale:
default_encoding: utf-8
admin_encoding: utf-8
set_names: true

Php Information:

phpversion: 5.2.17
md5_function: On (True)
gd_version: 2
tempnam_function: On (True)
magic_quotes_runtime: Off (False)
E_STRICT: 0
memory_limit: 64M
max_execution_time: 30
output_buffering: On
safe_mode: Off (False)
file_uploads: On (True)
post_max_size: 33M
upload_max_filesize: 32M
session_save_path: /var/chroot/home/content/78/8203678/tmp (0705)
session_use_cookies: On (True)
xml_function: On (True)

Server Information:

Server Api: cgi-fcgi
Server Db Type: MySQL (mysql)
Server Db Version: 5.0.92

----------------------------------------------
maranc
Forum Members
Forum Members
Posts: 249
Joined: Tue May 04, 2010 5:04 pm

Re: Reading private sku information from CG Ecom Base

Post by maranc »

Your answer is in class.cg_ecomm_cart.php.


Marek A.
Post Reply

Return to “Modules/Add-Ons”