Magento Custom Field Defines Product - magento

I am running a Magento store where someone can buy a personalized item with their name on it. Under the product, you see "Name:" with an input box where they can fill out their name. They click "Add to Cart", it ads it, I fill the order and everyone's happy.
But, in order to purchase another product with a different name, they have to go from the cart back to the product. Its a mess.
I'd like there to be a button under the "Name" field that says "Add Another". Upon click, it pulls down another field for "Name:". Now we see two name fields, I add "John" and "Joe" in the first and second fields, then click "Add to Cart".
In my cart, I now see two products added. One with Johns Name, and one with Joes.
Any and all help is greatly appreciated. I'm a Wordpress guy trying to figure out Magento!

This is not really a simple addition, but basically you'll need to modify app/code/core/Checkout/controllers/CartController.php to call addProduct for each of the items in the form. This isn't really a trivial change, as you'll have to rip apart that method to make it load the products in sequence.
Another approach would be to use an event (such as checkout_cart_product_add_after) to keep track of when an item is added and see if extra parameters were passed, adding more items as necessary.
Alternatively, you may be able to use related products to accomplish this (since they are added to the cart as well). I haven't looked at how to approach that one, but it may be worth a look.
Hope that helps!
Thanks,
Joe

Related

Shopify Script for Fixed Discount of a set price based on tags

Using Shopify Scripts :::
I am trying to achieve the below but getting issue. Could you please let me know how to do this.
$25 off a purchase of $125 or more from the "sale" section. These products have a tag "sale" and are also in a collection "sale" based on that tag.
Looking forward for your quick response.
Great Thanks
If you examine the documentation for Shopify Scripts you'll notice that there is no support for auditing the line item for tags. So you should try the other approach which is proven, and works well.
Look for an item with a compare at price. If you find one, then that typically means the item is on sale. So you can rig your logic to look for items with a compare at price, and if they have one, then determine if the cart has exceeded the $125 in value, and if so, apply your discount.
I can't give you the exact code as I don't know the structure of your code. But this is what you need to do.
Wherever a product can be added to the cart assign a JavaScript function to check if the product is of "Sale" collection. If yes, add an attribute cart.attributes.something.something and keep changing it as and when required.
When the checkout mechanism is present in the page, and if your conditions satisfy the Sale discount, take then to /checkout?DISCOUNT=<CODE> and click of checkout. It'll automatically apply the discount.

special price - how to remove in mass?

I hase set some special price, with a start date, and no end date.
Now I want to remove all the special price.
so no discount.
I went to the catalog view, I select ALL products, and clicked on "change attributes".
I've check the "updated" checkbox beside start date, and special price.
then I click apply.
I can see the special price disappeared, but... on the front end, I can still see the promotion!
How is it possible?
Now note that If I select a product on the backoffice, and If I click on "save" (without editing anything) then it works on the front end!!
Of course I re-indexed everything and cleared the cache.
I have 20k products so I cannot select all products one by one to click on "save"
thaks for your help
Rod
I use magmi for this. Most bulk operations are possible here. You'll definitely need this if you say you have 20k+ products.
Outside of this solution, you'll probably have to do stuff manually, write a script to manage the mass update, or write a direct SQL statement to update this. I'd post a query here but it can be too varied because of Magento's EAV system.

Custom Fields in Virtuemart allowing user to enter amounts

my question is probably simple for most but its troubling me and ive been googling for sometime now.
Im trying to create a product on this following website for a client
https://www.anigmabeauty.co.nz/index.php?option=com_virtuemart&view=category&virtuemart_category_id=1&Itemid=235
I want to create another Voucher called $100+ Gift Voucher with that voucher set at $100.00 obviously. when the viewer clicks on this I want to have a "Enter Amount" box where the viewer can enter the amount they want to pay for a Gift Voucher. for example if they wanted a $210.00 Gift Voucher, they simply enter $210.00
I managed to do this with custom fields but it then adds the amount entered (eg. $210.00) onto the $100.00 which I dont want. If it is possible I would like the $100+ Gift Voucher set to $0 dollars and whenever the viewer types in the value they want (eg. $210.00) and then go to the Shopping Cart the Total amount will be $210.00
Any help would be AMAZING
Thanks
I think you can't exactly do this with current VM without any core files modification especially cart helper and related files.
But i think you can achieve this in another way .like you are planning to provide a text box for entering the amount in front end . instead of that you can provide a list box with predefined values.This you can achieve by using the VM custom fields options .
There is one option for making a list of values for custom fields.
Hope this may help you..

wishlist integration in joomla

I am somewhat of newbeeeee to the whole Joomla/Virtuemart world. I am trying to implement "my wishlist" module in my joomla 1.5.26 . I have searched in google also but its not free.
My logic is like:
I have a list of products, along with button "add to wish list". If a registered user click on that button then that product id and category id have been saved in jos_user table, where I have added one new field called "wishlist".
Now up to this is okay. Now problem is to fetch those product in one page(lets say page name is my wish list), which are only in that list. Is there any file where I can change the query for that particular page(my wish list). If so please help me. Its urgent.
Thanks in advance.
If your wish list is a module rather than a component, then finding the required file to change the code shouldn't be too hard. I'm not quite sure on the file structure, but it will most likely be in something like helper.php

Using one stock for multiple items in Magento

Ok so what I want is to have multiple simple products draw from the same stock.
Scenario
I have a sinle nail file (Stock:500)
I have a box of nail files (50/box)
I want it so that if someone buys a box then it deducts from the 500 stock of the singles. Essentially what we do is if someone buys a box, then we ship them 50 of the single files in a box.
Any easy way to do this?
This isn't a native function of Magento, so there a few approaches you can take to emulate it:
Use an external stock management package to keep track of stock and modify Magento to use that. This will require more backend modification.
Attempt to fool Magento by using product bundles in clever ways. This will require more frontend modification
Develop or find a Bill of Materials plugin for Magento. I didn't see anything after a short search, so you may have to build it. Have that module check the constituent materials for a product before allowing it to be added to the cart.
Hope that helps!
Thanks,
Joe
Consider:
Create a template for the products that you wish to order this way. This template need only be the files you need to modify, by default it will find the missing files from your default theme;
In the template you can place some PHP to write out some extra javascript, of the prototype variety;
This frontend code hides the real quantity box, with prototype 'hide' for the relevant css id to make it a hidden form field;
The code shows its own quantity box, also an extra field for how many of the fifty packs are required;
An onchange event on these boxes gets the values of the boxes, does the required multiplication and addition, then updates the hidden 'real' quantity box with (boxes*50)+singles;
On submit the customer sees in the cart the total quantity of the product ordered - this will be total units, not broken down 'per box'. If this is a problem, you can put some words to explain that or modify your main template to handle this and present to the customer the boxes+singles breakdown;
Set your products to use the 'new theme' that has your template update code.
Test, test, test!
As mentioned by Joseph this cannot be done out of the box. The above workaround is only partial, however, so long as you make it clear to customers that they are buying 500 units instead of 500 boxes then you should have a reasonable solution.

Resources