WebsiteBaker Support (2.8.x) > Bakery Shop
Bakery: Small Shop Module (ORIGINAL TOPIC)
snark:
--- Quote from: Locoblade on April 23, 2010, 07:22:43 PM ---Hi All
I'm currently configuring Bakery for my wife's fabric business. Most of the items she sells are sold by length rather than as an individual item, so for example a customer may wish to buy 6m of a specific fabric that's priced at say £5 per half metre.
At the moment we can obviously ask customers to add multiples of the product to buy larger sizes but if for the example above, if a customer wants 6m they have to add "12" to their cart. Its not rocket science but not entirely intuitive so I'd prefer it if I could change it to suit. Is there an area of code I can edit to change the "Number of Items" display into a dropdown list of say 0.5m,1m,1.5m etc so the amount of fabric required can be directly chosen?
thanks in advance
--- End quote ---
with the option value you can create options for
1m + an 'extra price'
2m + an 'extra price'
3m + an 'extra price'
4m + an 'extra price'
etc +
that way people will have a dropdownmenu with the 'size' to order ...
you can even add an extra field for color ...
snark:
I want to make the phone number 'NOT' to be compulsory, it can stay but just is nog necessary to fill it in.
where do I have to change the files?
Locoblade:
--- Quote from: snoork on April 23, 2010, 08:09:01 PM ---
with the option value you can create options for
1m + an 'extra price'
2m + an 'extra price'
3m + an 'extra price'
4m + an 'extra price'
etc +
that way people will have a dropdownmenu with the 'size' to order ...
you can even add an extra field for color ...
--- End quote ---
Thanks Snoork, I did consider using the options dropdowns but the big downside is that for every material she needs to add in say 10 prices (for each 0.5m increment 0.5m-5m). With 20-30 different items obviously thats adds up to quite a bit of admin, especially if a bulk price change is required!
freeSbee:
Hi all
@ Locoblade
Replace in the "Layout Settings" the input field by a select (http://www.bakery-shop.ch/#default_item_quantity). Set something like:
--- Code: ---<select name="item[ITEM_ID]">
<option value="0.5">0.5</option>
<option value="1">1.0</option>
<option value="1.5">1.5</option>
<option value="2">2.0</option>
....
</select>
--- End code ---
@snoork
Make the phone number optional by replacing in the file view.php
--- Code: --- // Check for blank fields
foreach ($_POST as $field => $value) {
if ($value == "") {
$blanks[] = $field;
}
}
--- End code ---
by
--- Code: --- // Check for blank fields
foreach ($_POST as $field => $value) {
if ($value == '' AND $field != 'cust_phone') { // Phone optional
$blanks[] = $field;
}
}
--- End code ---
and replace in the same file
--- Code: --- if (eregi("phone",$field)) {
if (!ereg("^[0-9)(xX +.-]{7,20}$",$value)) {
$error_bg[] = $field;
$errors[] = htmlspecialchars($value, ENT_QUOTES)." ".$MOD_BAKERY['ERR_INVAL_PHONE'];
}
}
--- End code ---
by
--- Code: --- if (eregi("phone",$field)) {
if(!ereg("^[0-9)(xX +.-]{0,20}$",$value)) { // Phone optional
$error_bg[] = $field;
$errors[] = htmlspecialchars($value, ENT_QUOTES)." ".$MOD_BAKERY['ERR_INVAL_PHONE'];
}
}
--- End code ---
Regards Christoph
Locoblade:
Many thanks Christoph, that's brilliant. What I've put in seems to work fine on the item detail pages but the same doesn't on the overview. When clicking Add to Cart on the overview, nothing happens, any idea why?
this is my overview (Product Loop) code:
--- Code: ---<td class="mod_bakery_main_td_f">
[THUMB]
<br />
<a href="[LINK]"><span class="mod_bakery_main_title_f">[TITLE]</span></a>
<br />
[TXT_PRICE]: [CURRENCY] [PRICE]
<br />
<select name="item[ITEM_ID]">
<option value="1">0.5m</option>
<option value="2">1m</option>
<option value="3">1.5m</option>
<option value="4">2m</option>
<option value="5">2.5m</option>
<option value="6">3m</option>
<option value="7">3.5m</option>
<option value="8">4m</option>
<option value="9">4.5m</option>
<option value="10">5m</option> ....
</select>
<input type="submit" name="add_to_cart" class="mod_bakery_bt_add_f" value="[ADD_TO_CART]" />
</td>
</form>
</td>
--- End code ---
cheers
Chris
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version