Discussions

need information right next to price...

Hi,

still new to Drupal Commerce per legal requirements I have to add a small size text
(like "price inclusive VAT plus shipping ") with a link to a shipping price overview
right next to the price.

A separate line or a line at the bottom of the page is not sufficient. The reference
must be placed right next to the price.

I thought of a custom currency format or more influence on the formatting of the price
in admin/commerce/products/types/product/display .

Is there a recommended way to archive this?

Ingo

Posted: Dec 11, 2011

Comments

commercestudy on December 11, 2011

You said: "I have to add a small size text
(like "price inclusive VAT plus shipping ") with a link to a shipping price
overview
right next to the price."

Under:
Home » Administration » Structure » Content types » Your content type to go with
your product type, what ever you have named it

Click on add fields in the content type for the product.

Add a new field. ":Choose long text" as the field

Then when you are asked to fill in details for the field.

Put Text processing as "filtered"

Then under Default value, put in the HTML you want for your small text <p
class="vat">price inclusive VAT plus shipping<p> perhaps between paragraph tags
or span tags depending on what suits your design. Give the tag a class like
class="vat" so you can target with CSS easily and make the text small, like you
wanted too. Then in the same area you will want to also put the HTML for with a
"link to a shipping price overview
right next to the price". So put in <a class="ship"
href="address-to-your-shipping-price-overview-page">Shipping price overview</a>
for the link. I have also given the HTML for the link a class so you can target
it with CSS. You may want to put a HTML break tag in between them too, like so
<br /> . Once that field is done and you have saved it, it will be ready to
automatically put in the HTML on all your products.

Now go to the to the tab above the content type, called manage display and drag
and drip with your mouse where you want that field to be displayed on your
product (Under or above product price, I would imagine

inki on December 11, 2011

Great tutorial for a basic functionality as I understand now.
Thanks a lot. This worked like a charm :-)

Ingo

commercestudy on December 11, 2011

It is good that it worked, however if you want that extra field to be able to be shown on a view (Setup for products) as well as on product nodes. The field would need to be made at Home » Administration » Store » Products » Product types » Your product type name

I did not recommend putting the extra field in your product type though, due to failed experience. I have tried to put an extra, 'long text field' in the product type and the text field would not show in the related content type? That is the only reason I did not recommend putting the field in the product type instead of the content type. I have however months ago, successfully put an extra 'text' field in a product type before and that field, did successfully automatically show up in the content type that has a relationship to the product type automatically.

However when I tried this very recently with long text, it did not work. Perhaps I have forgotten something I did right back then? If anyone knows how to add extra fields to the product type, so that they show in the related content type, please let us know?