eZ Community » Forums » General » Webshop - Send product properties
expandshrink

Webshop - Send product properties

Webshop - Send product properties

Tuesday 12 January 2010 7:34:55 pm - 5 replies

Hi,

I have a class product in ezPublish which is linked to some other property classes (color, size...). To link the classes, I use objectrelations fields.

I want to be able to order a product using the webshop, precising what color and size I want.

For what I've seen, I can only set the quantity when I order a product.

Is there a way to add some fields to the product's description in the webshop on the client side and also in the admin ?

Thanks

Wednesday 13 January 2010 8:01:42 pm

Well, after a few searches, I found a way to do that.

First, I added some Option attributes in my class Product ("sample_colors", "sample_sizes"blunk.gif Emoticon. Then, in the cart's form I added some "attribute_view_gui attribute" to display some drop-down menus with the options I filled in the admin :

<form method="post" action={"content/action"|ezurl}>
{attribute_view_gui attribute=$node.data_map.sample_colors}
{attribute_view_gui attribute=$node.data_map.sample_sizes}
<input type="submit" class="defaultbutton" name="ActionAddToBasket" value="{"Add to basket"|i18n("design/base"blunk.gif Emoticon}" />
<input type="hidden" name="ContentNodeID" value="{$node.node_id}" />
<input type="hidden" name="ContentObjectID" value="{$node.object.id}" />
<input type="hidden" name="ViewMode" value="full" />
</form>

Now, the options are added to the product when ordering and I can see them in the admin.

The last thing wrong now is the email sent, which doesn't include them. But I guess it's not a big deal. If someone knows how to do that, thanks blunk.gif Emoticon

I hope it will be useful for someone.

Wednesday 13 January 2010 8:22:15 pm

Have a look at order confirmation template for example, for code that displays order item options.

Wednesday 13 January 2010 8:23:01 pm

Good to see you found your way Jérôme!

The last thing wrong now is the email sent, which doesn't include them. But I guess it's not a big deal. If someone knows how to do that, thanks blunk.gif Emoticon

You may want to have a look at the 'shop/orderemail.tpl' template. Not sure you are talking about the confirm-order-email though. If this is the case, you can create an override for the latter template, and do pretty much what you like in there (cf eZDefaultConfirmOrderHandler::sendOrderEmail in the file kernel/classes/confirmorderhandlers/ezdefaultconfirmorderhandler.php, l.67 in eZ Publish 4.2).

I hope it will be useful for someone.

It definitely is, and thanks for sharing!

Cheers,
--
Nicolas

Wednesday 13 January 2010 8:24:36 pm

Oops, simultaneous answers with Zurgutt happy.gif Emoticon

Thursday 21 January 2010 7:26:42 pm

Hi

Thanks for the answers. I could change the default behaviour creating an override of orderemail.tpl.

I was wondering, is there a way to send a differernt email to the admin ?

Thanks

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from