WebsiteBaker Support (2.8.x) > Bakery Shop
Bakery: Small Shop Module (ORIGINAL TOPIC)
freeSbee:
Hi Deborah
In this case you do not have to make use of the free-definable text fields. Just write
--- Code: ---Racer's full name: <input type="text" size="25" name="racername">
--- End code ---
into your template. Make sure the input field is inside of the form tag otherwise it will not be submitted!
Then catch the $_POST['racername'], sanitize it and do whatever you want using the appropriate PHP code.
Regards Christoph
dellington:
Could you say a little more about this:
--- Quote from: freeSbee on February 27, 2010, 02:36:50 PM ---Then catch the $_POST['racername'], sanitize it and do whatever you want using the appropriate PHP code.
--- End quote ---
Which files would I edit? The save_attribute.php one?
freeSbee:
--- Quote from: dellington on February 27, 2010, 02:52:12 PM ---Which files would I edit? The save_attribute.php one?
--- End quote ---
view.php is a good starting point. Other files involved will be included - just have a look into the code. It is well commented.
Regards Christoph
dellington:
Sorry, I haz the dum. I tried to make that work and only broke the cart. :-(
I fixed it back the way it was and now it works again.
I'm wondering if it might be easier to hijack one of the existing fields I'm not using? For example I am not using the sku field. I see that it gets inserted into the mod_bakery_order table.
Could I name my racername field to sku and then do some post thing to get it inserted into the database?
Then I could make use of the existing template strings that would display the sku field in the order details and confirmation emails.
Does that make any sense?
dellington:
I have modified the page settings template to include:
--- Code: ---Racer's full name: <input type="text" size="25" name="racername">
--- End code ---
I have updated the language file as follows:
--- Code: ---$MOD_BAKERY['TXT_SKU'] = 'Racer\'s Name';
--- End code ---
Line 239 of the view.php file originally says this:
--- Code: ---$sku = $row2['sku'];
--- End code ---
My understanding of that area of code is that it is collecting the item's sku # from the mod_bakery_items table and then inserting it into the mod_bakery_order table.
I would like instead for view.php to get the value for the sku field from the racername input field in my current order. I tried changing line 239 to this:
--- Code: ---$sku = $_POST['racername'];
--- End code ---
but it doesn't work - the sku field in the database is still blank.
It seems like this should work and I am just missing a small step somewhere. Any help?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version