Closed (fixed)
Project:
Commerce Stock
Version:
7.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
27 Apr 2011 at 17:23 UTC
Updated:
22 Nov 2014 at 20:40 UTC
Jump to comment: Most recent
Comments
Comment #1
rfayThanks for taking a look :-)
It's just the way it was when I got it. Never changed it. I don't really have a commitment to it. Patches are welcome.
Comment #2
BenK commentedOne aspect of the current implementation is that if the user hovers over the disabled button, the mouse cursor turns into a pointer as if it is a clickable link. That's a bit confusion because if you try to click it, nothing happens. Any way to make the disabled button not appear clickable?
--Ben
Comment #3
BenK commentedOne more thing: Another issue with the current disabled button implementation occurs if you override the string for either the "Add to cart" text or the "Out of stock" text. If those two text string have substantially different numbers of characters (and you've used a lot of CSS to make the button prominent), then it's possible that the button gets pushed into adjacent layout items. (This happened to me.)
--Ben
Comment #4
vasikesubscribe. more flexibility needed for the stock value, some settings, more options.
maybe the stock settings/options should be within every product type definition/page/form.
Comment #5
guy_schneerson commentedversion 2 lets you control the text but its still using the disabled button.
Comment #6
summit commentedHi, I would love to be able to link the disabled button to a helppage. Something like More info why the product is not in stock, and that someone can order it by email if necessary!
So it would be great if the disabled button was enabled and has link-possibility next to having text!
Thanks a lot in advance for considering this!
Greetings, Martijn
Comment #7
guy_schneerson commented@Summit and anyone following this thread.
Missed this one out, it should have been closed a long time a go as this is now supported in 2.
What you need to do is:
(can be any valid HTML)
Optionally set the "stock action" field to "URL Action" and the "Custom URL" field to a valid url.
You can also set the "stock action" field "Custom submit" to trigger a custom submit (will need coding for you submit handler)
Comment #8
guy_schneerson commentedComment #10
Cheviot commentedHi, thi was the trick I was looking for. When a product is out of stock then the 'add to cart' should change to redirect buyers to the shop keeper to aks it something can me made on order. I my case something exists as a product or has to be made on order (the "out of stock" phrase is never used).
It should be possible to create a rule to add the product SKU in the email header, any idea how this can be done? I see no field in "Advanced configuration of the add to cart form" for this so I assume some variable is needed and another rule step.
Comment #11
Cheviot commentedSolved this via some experimenting. This relates to the "Stock: disable add to cart " rule.
A sample is sometimes the best way to understand how it works. The data of the current page (a node from 'product list' or 'full content') is parsed to the webform using the rule of guy_schneerson. This mean you need to have to right syntax in the custom URL field and then the right syntax in the webform to be able to get the data parsed via the url into the subject field.
In Rules -> "Stock: disable add to cart " -> "Advanced configuration of the add to cart form" (the part made by guy_schneerson, an action):
Custom URL
[site:url]webform/product-queries?subject=[commerce-product:sku].
This will parse the SKU via the subject info inside the url and looks like this https://[your-server]/webform/product-queries?subject=ABCD12345 but the subject field of the email webform is still empty. You need to 'grap' the subject info out of the url and place it in the subject box. Since I only need one bit of info I parsed this in the subject box by amending the webform subject field to:
Default Value
[current-page:query:subject]
And voila, it appears. Though there are many samples on the web, it seems a bit unclear to many what the right steps are. The focus is too much on the token in the email webform. But they can never work, the moment an email webform is opened the original data of the page you came from is lost. So, using a token for current page only give the url of the email webform itself baffling many. Others use the bespoke query like [current-page:query:subject] but are stuck when nothing appears.
Hope this gives some help to other struggling to figure out what the right order and syntax is.