Add to Cart button

Author Message

Blu Cava

Tuesday 14 January 2003 11:53:32 pm

Ok guys.. here goes.. I have just installed the version 3 of the EzPublish. I also installed the demo stuff. Now if you notice on the demo sites, when you go to the shop part, you can view the description of the files, you can also add to wish list, but you can not add to basket (Shopping Cart), or at least I can't figure out a way how to do it. I tried adding a product, but I could not find a way how to make it possible for users to ADD item to the basket. Any help would be greatly appreciated.

Thanks in advance,
Blu Cava

Bård Farstad

Wednesday 15 January 2003 1:35:22 am

> Ok guys.. here goes.. I have just installed the version 3 of
> the EzPublish. I also installed the demo stuff. Now if you
> notice on the demo sites, when you go to the shop part, you
> can view the description of the files, you can also add to
> wish list, but you can not add to basket (Shopping Cart), or
> at least I can't figure out a way how to do it. I tried
> adding a product, but I could not find a way how to make it
> possible for users to ADD item to the basket. Any help would
> be greatly appreciated.

That's a bug which was introduced just before the RC1 release. If you replace the contentActionList() function in kernel/classes/ezcontentobject.php with the code below it should work fine.

/*!
Returns an array of the content actions which can be performed on
the current object.
*/
function &contentActionList()
{
$version = $this->attribute( 'current_version' );
$language = $this->defaultLanguage();
if ( !isset( $this->ContentObjectAttributeArray[$version][$language] ) )
{
$this->ContentObjectAttributeArray[$version][$language] =& $this->contentObjectAttributes();
}

// Fetch content actions if not already fetched
if ( $this->ContentActionList === false )
{
$contentActionList = array();
foreach ( $this->ContentObjectAttributeArray[$version][$language] as $attribute )
{
$contentActions =& $attribute->contentActionList();
if ( count( $contentActions ) > 0 )
{
$contentActionList =& $attribute->contentActionList();

foreach ( $contentActionList as $action )
{
if ( !$this->hasContentAction( $action['action'] ) )
{
$this->ContentActionList[] = $action;
}
}
}
}
}
return $this->ContentActionList;
}

--bård

Documentation: http://ez.no/doc

sergey podlesnyi

Wednesday 15 January 2003 5:51:29 am

I have similar problem, in my case in one installation (Windows) my product pages showed "Add to cart" button correctly. I moved templates and database dump to Linux box and instead of "Add to cart" there appeared "Add to wishlist".

After I installed this Bård ' s patch "add to wishlist" disappeared but I still do not have "add to cart" button. Worst of all, it worked initially when I was designing on Windows laptop. EZ publish versions are the same (2.9.6)

I guess this is because my product "have run out of stock" somewhere in database but I can not find place in Admin interface where to fix availability of the product.

Bård, can you help?

>
> /*!
> Returns an array of the content actions which can be
> performed on
> the current object.
> */
> function &contentActionList()
> {
> $version = $this->attribute( 'current_version' );
> $language = $this->defaultLanguage();
> if ( !isset(
> $this->ContentObjectAttributeArray[$version][$language] )
> )
> {
>
> $this->ContentObjectAttributeArray[$version][$language] =&
> $this->contentObjectAttributes();
> }
>
> // Fetch content actions if not already fetched
> if ( $this->ContentActionList === false )
> {
> $contentActionList = array();
> foreach (
> $this->ContentObjectAttributeArray[$version][$language] as
> $attribute )
> {
> $contentActions =&
> $attribute->contentActionList();
> if ( count( $contentActions ) > 0 )
> {
> $contentActionList =&
> $attribute->contentActionList();
>
> foreach ( $contentActionList as $action
> )
> {
> if ( !$this->hasContentAction(
> $action['action'] ) )
> {
> $this->ContentActionList[] =
> $action;
> }
> }
> }
> }
> }
> return $this->ContentActionList;
> }
>
> --bård

Blu Cava

Wednesday 15 January 2003 7:35:36 am

Ok Bård.. thank you for your reply. I tried changing the content of the fucntion &contentActionList() but it still only shows Add to wish List, and New Review buttons. for some items it actually does not even show the add to wish list button. It only shows New Review button. Any other suggestions?

Thanks in advance.

BluCava
>
> That's a bug which was introduced just before the RC1
> release. If you replace the contentActionList() function in
> kernel/classes/ezcontentobject.php with the code below it
> should work fine.
>
> /*!
> Returns an array of the content actions which can be
> performed on
> the current object.
> */
> function &contentActionList()
> {
> $version = $this->attribute( 'current_version' );
> $language = $this->defaultLanguage();
> if ( !isset(
> $this->ContentObjectAttributeArray[$version][$language] )
> )
> {
>
> $this->ContentObjectAttributeArray[$version][$language] =&
> $this->contentObjectAttributes();
> }
>
> // Fetch content actions if not already fetched
> if ( $this->ContentActionList === false )
> {
> $contentActionList = array();
> foreach (
> $this->ContentObjectAttributeArray[$version][$language] as
> $attribute )
> {
> $contentActions =&
> $attribute->contentActionList();
> if ( count( $contentActions ) > 0 )
> {
> $contentActionList =&
> $attribute->contentActionList();
>
> foreach ( $contentActionList as $action
> )
> {
> if ( !$this->hasContentAction(
> $action['action'] ) )
> {
> $this->ContentActionList[] =
> $action;
> }
> }
> }
> }
> }
> return $this->ContentActionList;
> }
>
> --bård

sergey podlesnyi

Friday 17 January 2003 4:38:52 am

Hey Blu,

have you had a chance to resolve this problem - Add to cart button not displayed ? It looks like nobody wants to answer :-(

Thank you,

Sergey

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 05:19:33
Script start
Timing: Jan 18 2025 05:19:33
Module start 'layout'
Timing: Jan 18 2025 05:19:33
Module start 'content'
Timing: Jan 18 2025 05:19:34
Module end 'content'
Timing: Jan 18 2025 05:19:34
Script end

Main resources:

Total runtime0.8713 sec
Peak memory usage4,096.0000 KB
Database Queries65

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0066 589.3438152.6250
Module start 'layout' 0.00660.0034 741.968839.4453
Module start 'content' 0.01000.8598 781.4141625.4844
Module end 'content' 0.86980.0015 1,406.898416.1719
Script end 0.8712  1,423.0703 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.4063160.0002
Check MTime0.00150.1707160.0001
Mysql Total
Database connection0.00080.094510.0008
Mysqli_queries0.785090.0972650.0121
Looping result0.00060.0647630.0000
Template Total0.839096.320.4195
Template load0.00180.205820.0009
Template processing0.837296.088620.4186
Template load and register function0.00020.024110.0002
states
state_id_array0.00090.102910.0009
state_identifier_array0.00120.137020.0006
Override
Cache load0.00190.22151740.0000
Sytem overhead
Fetch class attribute can translate value0.00060.064230.0002
Fetch class attribute name0.00130.152660.0002
XML
Image XML parsing0.00080.091130.0003
class_abstraction
Instantiating content class attribute0.00000.001460.0000
General
dbfile0.00090.1008170.0001
String conversion0.00000.001340.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
7content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 26
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs