Download & Extend

alternative to out of stock message is button to reserve the product

Project:Ubercart Out of stock Notification
Version:6.x-1.4
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (works as designed)

Issue Summary

I am modifying your code to change the button to "Add to Reserve", because my client is also putting products that are out of stock for the meantime but buyers can already ask for reservations if the product becomes available, then it turns into a sale, what I did is just a hack but I know you can do a lot better for this option

AttachmentSize
1_client_product_view1.png57.1 KB
invoice_with_reservation.png50.34 KB

Comments

#1

Could you post how you do it?
I need exactly the same thing
So i can draw lists of orders and reservations.

thx

#2

hi, for now, the codes aren't clean, but i'll tell you how, for the button to change to something else, just open the uc_out_of_stock.js and you'll find the codes: (you have to comment this out)

$("input:submit.node-add-to-cart,input:submit.list-add-to-cart", form).hide();
$(".uc_out_of_stock_html", form).html(html);

this is hiding the button, all you need to do is to change this button to something else like the one i did:

$("input:submit.node-add-to-cart,input:submit.list-add-to-cart", form).attr('value','Reserve Only').attr('title','Reserve this product now. And, you will be notified as soon as its available.').after('This product is out of stock.');//changes - daniel

for the "for reservation" info to appear on the product page or on the receipt, just create an attribute of the product, the rest are actually just configurations of ubercart.

if the author of this module doesn't respond to my request, I'll be happy to make to this into a module, hope this helps you.

#3

thx for the fast responce.
we want to do it the other way around.

We have products with limited stock.
sell them
and if the stock is depleted the costumers can still 'buy' the product but should be put on a waitinglist.

an other solution would be to make a waithinglist product and let the out of stock link to that but than you dont know for witch product ther on the waitinglist/reservation.

adding attributes is not an solution unles you can use views for populating the attributes so its depended on date and modify itself over time.

A form field with a list of all nodes is an other solution but i dont know how to do that eater.
Could you help me?

thx in advance

#4

hi, the purpose of the reservation is actually putting the clients in
a list of orders with reservation attributes, the out of stock module
is dependent on the stock level which must be turned on, now depending
on the value of stock number the button changes, the attribute is also usefull on condition and action, you just have to configure the condition and action to notify the client or yourself if
the order status changes or attribute changes, there are a lot of
thing you can do with ubercart like conditions and actions. If you
want the clients to pay on reservation that's up to you. Just examine
the power of this condition and action in ubercart carefully, you
might find the answer there.

#5

hello me again,

I cant even get the custom text to display.
the stock module is on and set to 0, so its depleted.
the add to card button is till visible.

And i dont get the waitinglist feature up and running
running ubercart 2.2

thx for the support.

#6

hi, after you have done it correctly by changing the codes in the javascript, try clearing the cache, this might help.

#7

This thread helped me a lot. Here's how i changed it

on line 64 of uc_out_of_stock.js

      if (stock == parseInt(stock) && stock <= 0 && data.length == 2) {
        html = data[1];
buy_in_store = '<a href=\"/node/1" class=\"form-submit\" title=\"Sorry, this product can not be purchased online\" style=\"color: #7E0241; text-align:center; width:80px; height:auto; display:block; margin:0 auto;\">Buy In Store</a>'; //added by Schweb
if(product.nid == '10'){ //added by Schweb
$("input:submit.node-add-to-cart,input:submit.list-add-to-cart", form).hide(); //added by Schweb
$(".uc_out_of_stock_html", form).html(buy_in_store); //added by Schweb
} //added by Schweb
else { //added by Schweb
$("input:submit.node-add-to-cart,input:submit.list-add-to-cart", form).hide();
$(".uc_out_of_stock_html", form).html(html);
} //added by Schweb
      } else {
        // Put back the normal HTML of the add to cart form
        $(".uc_out_of_stock_html", form).html('');
        $("input:submit.node-add-to-cart,input:submit.list-add-to-cart", form).show();
      }

hope this helps someone.

#8

Subscribing, greetings, Martijn

#9

Subscribe.

#10

following

#11

Status:active» closed (works as designed)

This is a very specific feature request. If someone wants to provide a patch so that it's added as an extra feature (w/o changing how the module works) I will try to review it, but so far this issue are mainly hacks to have it working for this specific use which falls a bit outside the scope of the module which is to prevent purchases of out of stock items.

nobody click here