Share » Forums » Install & configuration » Add to Cart button

Add to Cart button

Add to Cart button

Tuesday 14 January 2003 11:53:32 pm - 4 replies

Author Message

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

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu