Display the list of products in a tab - magento

In my magento application i want to create a module which is for adding FAQ for a individual product. So while adding the FAQ, in the new tab i want to show the list of all products(like product listing) for which product we want to add FAQ.
So please help me how to customize for getting list of products and display in the new tab?

The question is too broad friend. So don't hope any full solution here. That is because, this question is related to an external extension. But you will get guidance here. Here you may need to do following things.
I think in admin, the extension provides provision to manage each individual faque. What you need to do is, you need to create an extra field that will relate that faq with a product or multiple products.
If you set up this, you need to store this information in database. So for each faq, there may be a product id or multiple product ids related to it
Now you need to create a new block for your extension. This block will filter faqs that related to a particular product.
Next step is add above block in layout. Layout handle you need to use here is catalog_product_view.
Create a new template for your custom block and in that template file, you need to put design codes. You can create this template with the help of current template that this extension uses. That way, you can reduce a lot of time for creating the design.
Hope that helps !

Related

Magento Custom Module Grid Serializer

I am working on a custom Magento module to enter Composer information (name, bio, birth, death, etc.) and associate products (songs) with the composer. The module contains two tabs, one for the general info and the other for a list of the products (songs). The association should work exactly as the functionality of Related Products, Up-sells, and Cross-sells in the Product editing page. I feel like I've been running around in circles on a few points in regards to paging through the available songs and selecting and saving the entries. It's mainly dealing with the Grid Serialization. I've looked through as many resources as I can find, including several tutorials, without any luck:
http://magebase.com/magento-tutorials/understanding-the-grid-serializer-block/
I've posted the relevant files at this Gist and would appreciate any feedback or discussion. The files have a lot of material commented out from trying various solutions but they may prove useful in terms of thought process. Certainly available to post any other files that may be relevant.
I think this answer is exactly what you need. I know that single link answers are not very appreciated but the answer is kind of long to replicate in here.
You can also use this module creator to create you module (also available on magento connect). It has an UI that let's you create the modules in a similar way with how you create a table using phpMyAdmin. For each entity you create in your module you have the ability to say "Link many to many with products". This will create the the relation table between products and your entity and the second tab in the admin where you can choose products that are associated with your entity. Exactly like the products in the categories or like related products.
I admit that I'm the developer of the extension, but this should not be considered as spam since the extension is free and I get no profit out of it.

add new attribute for reviews and rating section in magento

there are some default attributes in reviews and rating section, they are Product,Posted By,Summary Rating,Detailed Rating,Status,Nickname,Summary of Review and Review. now i want to add one more attibute named "selected size", how can i finish that ?
Reviews are not EAV entities. So extending this is somewhat easier.
1) You can add a new field in the review_detail table and extend the module to also save this new field. You will not need to do too much work at the module level (mostly the effort is to display this new field in new review form and related views).
2) You can create a new table (don't alter Magento's core db Tables) with a reference to Review (review_id) and your custom field. This also means to extend Review model's and use afterSave, afterLoad functions to save/retrieve your data...
3) Duplicate entire module logic with custom tables (I've seem some more than a few commercial extensions that have this approach to do stuff with reviews, inventory and so on). Not recommended.
you should create a module with a sql upgrade script. it's covered in tutorials by alan storm and in the database section of the videos series provided by magento, available in your account section of their site. these 2 resources both cover the rest of the skills you'll need to finish your work in accordance with magento programming practices.
In Magento 1.x review attributes are managed under >Catalog > Ratings > Manage Ratings.
In Magento 2.x they they are managed under Stores > Atrributes > Ratings.
There you will be able to add, edit or remove review attributes such Price, Quality, Value, etc.

Magento: Add New Field to Credit Card Form

I'm trying to modify the credit card form to add some new custom fields named "Bank Name" and "Bank Phone Number" and it seems this cannot be done through the back-end.
I've searched the web and on here but I haven't been able to find anything in reference on how to add a new custom field to the credit card form. I would think it's almost the same as adding a new field to the customer registration form but I have no clue what to do database wise.
If anyone has anything I can use to work on this, I'd greatly appreciate it.
You should start by informing which version of Magento you are using and which methods you have already tried.
Without knowing that it is hard to help you, but you might want to try this possible solution, this one, or even one of these modules: Checkout Fields Manager or ADDITIONAL CHECKOUT ATTRIBUTES. If none of the above work, try this search.
No, Magento admin panel will not add custom columns for you. You need to do it yourself.
First, you need to edit the .phtml file to include these two fields to show up in frontend.
Second, you need to add two new columns (with same name as your fields, explained later) in relevant DB table (i guess sales_flat_order_payment). But that will affect for all payment methods, so define it something like VARCHAR(255) NULL.
Third, when Magento saves the CC info, you need to check if it is saving whole data array, then your field's name posted will match your table field and get inserted automatically. Else you need to edit it.
Also, next time please post some code, atleast something you have tried.

Retrieving articles based on custom URL parameters

I'm a beginner using Joomla 1.5. I have a page which shows articles in a blog format. My objective is to show/filter the articles per year (which isn't that many) based on user input. I'm planning to create a module on the right side, showing a dropdown box of the years, and retrieve the results by passing the year parameter as part of the URL
Ex.
http://sample.com/index.php?option=com_content&view=category&layout=blog&id=39&Itemid=24&year=2011
What is the best, simplest way of passing and processing additional parameters to com_content via URL? Can I do so using extensions such as K2 and flexicontent? If not, can someone advise me what code to add and where, in com_content? If I have to extend com_content itself, can someone guide me how to or point some useful articles?
Appreciate the help. Thanks
I don't know if K2 or flexicontent offer this option, but com_content appears NOT to have this feature.
I would just build a module, create a query and use the table jos_content, select only the fields that you need (like title) and check the field created to be in the year you need.

Magento: Add a "fake" product to cart/quote

I understand how to programmatically create a product and also add to cart. I know this might sound dumb but is it is possible to generate a product on the fly and add that to the cart/quote but never actually save it in the database.
We want to create a made to order interface and I was thinking at the end it could add a bundle product with all the selections but that bundle product wouldn't actually exist in the backend.
I figured as long as you can make sure the quote and order has what it needs in terms of the product it would be ok, but obviously there is probably a lot that is tied to looking up stuff in the db on a specific sku or ID. I know that if you delete a product and then look at an order in the admin that causes issues, at least it did for this one scenario I was dealing with.
I was thinking of creating a giant bundle product that had like 6 different bundle items and each item could potentially have like 500 products and then based on what the user selects I programmatically add the bundle to cart. But then I wasn't sure if there would be a negative affect with having a gigantic bundle product like that as well.
UPDATE:
I don't think this will work, obviously there are a lot of information tied to the product in the database and we setup a test and right away we get an error for $item->getProduct(). We are moving forward with creating a giant bundle product and also the generic product with adding custom options on the fly, which Anda pointed out below. Any other suggestions will be greatly appreciated.
I'm not sure that clockworkgeek's approach is going to work. On every page load, Magento loads the items from the cart to make sure that they are still valid (in-stock, prices correct, etc), and amends the cart to reflect those values. My understanding of the system in the past has been that a product in the cart needs to have a corresponding database value to survive this process.
The "giant bundle product" approach is a pain, but in the past has been the best approach I have found. Attempting to change the values of the product (such as price or attributes) will be overridden by the cart checks, so you need a product w/ maximal flexibility, such as an overly-customized bundle product or configurable product.
Hope that helps!
Thanks,
Joe
Why not create a generic product in db and then set the product customization as custom options (additional_options) on the fly depending on the user selection. You can add custom options to the product (actually to the quote item) without having to save them in the database. I did this once for a website that sells glasses with prescription. The prescription was added as an option.
You can programmatically create Mage_Sales_Model_Quote_Items and add them to the cart. You've noticed it needs a product to match it's product ID but it needn't be a useful one. It could be a blank, disabled product, also created in code. All that's needed is a stub.
The necessary stuff for the cart is stored in the quote item - fields like name, value and quantity. Those fields are then copied directly to the order without using a product.
Mage::getModel('catalog/product')
creates a new product. you can add it to a cart, by doing something like this:
$cart = Mage::getSingleton('checkout/cart');
$product = Mage::getModel('catalog/product')
->setStoreId($storeid)
->setTypeId($type_id)
->setQty($quantyty)
->setWhatAttributYouWant($attribute);
$cart->addProduct($product);
product attributes you can find in the DB in tables that start like catalog_product_... or take an already created product, and see what attributes it has in the _data array (with debugger or just print_r($product->getData))

Resources