Magento - Db Query To Get Full Product URLs?
I am looking to interact with the database outside of Magento. Upon reviewing tables in the database, catalog_product_flat_1 seems to store the majority of the information I am looking to retrieve so this gets me just all about everything but the final step. I am trying to understand the relations within the Magento DB and get all the full product URL's into my newly created table.
The purpose of this is for an SEO/PPC initiative where having a nice list of every product sku, name, brand, description and url directly to the product would make the work a breeze. I have everything working just fine aside from the full product URL. I have been doing a good amount of reading and it appears more people are using SQL injections within the normal Magento methods, but I am looking to do this with the database outside of the site.
View 1 Replies (Posted: May 11 at 14:39)
Sponsored Links:
Related Forum Messages:
Magento: Adding Query String To End Of Product Url?
I am looking for a better way to do a modification.. I am adding a query string to the end of the product url. For example, the url would look like [URL] notice the ?flagged=yes. I am currently doing this by adding the following code to the list.phtml file: $query = '?flagged='.$answer; then I add this query string to the end of the product url by doing this: $_product->getProductUrl().$query I really like to try and leave modifications off the template file.
Posted: Feb 24 at 14:32
View 3 Replies!
View Related
Magento, Custom Product List - Include A Product Listing On A CMS Page ?
I made my own product list page based on Mage_Catalog_Block_Product_List: app/code/local/Mage/Catalog/Block/Product/Special.php: class Mage_Catalog_Block_Product_Special extends Mage_Catalog_Block_Product_List { /* Original contents */[code]... The problem is: The product list shows up just fine, but I get no layered navigation in my left column.This is quite strange, since I am using exactly the same template as normal listings.A couple of things I have checked: Mage_Catalog_Block_Product_Special just being a proxy class. This doesn't work. Even if I use block type "catalog/product_list" on my CMS page I will not get a layered navigation.There are no extensions that are overriding crucial core classes.I have also tried to create my own module and list it under for example 'mycatalog'. This results in exactly the same problem.I have a feeling this has to do with trying to include a product listing on a CMS page but I have not been able to track down the exact problem.
Posted: Mar 3 at 17:30
View 4 Replies!
View Related
Display Configurable Product In Each Color In Magento Product Listing?
I have a configurable product which is available in many different colors and sizes. I want the configurable product to appear once for every color. My idea is to assign one simple product of the configurable product in every color to the category of the configurable product. Then I want to change the listing, so that the (colored) simple product links to it's master product (the configurable one). The other way would be, to just assign the configurable product to a category and then list it multiple times with different colors. But I think this would be to complicated. Solution Sincerely I have lost my code. But here is how I've managed it: Set visibility for all slave products to "catalog" so that they appear in the product listing Override the Product Model and it's getProductUrl function: public function getProductUrl($useSid = null) { $product = $this; $product->loadParentProductIds(); $parentIds = $product->getParentProductIds(); if(count($parentIds) > 0 && $product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_SIMPLE) { $parent = Mage::getModel("catalog/product")->setId($parentIds[0])->load(); return $this->getUrlModel()->getProductUrl($parent, $useSid);........
Posted: May 17 10 at 7:02
View 3 Replies!
View Related
Checking If A Magento Product Is A A Child Of A Configurable Product
I have the following code to grab a list of Products $collection = Mage::getModel('catalog/product')->getCollection(); $collection->addAttributeToSelect('name') ->addAttributeToFilter("category_ids", array('finset'=>$this->category_id)); foreach($collection as $product) { echo $product->getName(); } My question is, how can I NOT echo products that are 'simple' but belong to a parent 'configurable' product. (for example don't show "Red Shirt Medium" as it belongs to "Red Shirt") I have worked out that this association lives in 'catalog_product_super_link' but I have only just started with Magento and unfortuantely don't know how to do the filtering :)
Posted: Nov 10 09 at 7:03
View 2 Replies!
View Related
Retrieve Full Category Path For A Product?
I'm building a shopping cart and I would like to know how can I get the full category path for a product. Let's say I have the following category structure: "Electronics (parent) -> TV -> Plasma TV" and my product belongs to the last category. How should I write a script to return full category path like the one above. My categories table looks like this: - category_id - category_parent_id - category_name
Posted: Jul 18, 2009, 07:23
View 2 Replies!
View Related
Get Product Id In Magento?
In magento,i want to add quick look feature like this http://www.timberlandonline.co.uk/on/demandware.store/Sites-TBLGB-Site/default/Link-Category?cgid=men_footwear_boots.I have added a hidden input & a div in list.phtml.If i click the div of any product javascript returns product id of first product in that category page.But it should return product id of the selected div.
Posted: Mar 10 at 6:40
View 1 Replies!
View Related
Best Magento Associated Product Options?
I have imported all of my products as configurable and their options as simple product types, all the simple products have the correct size attributes and the configurable products have the right attribute_set. What is the best way of associating the product options with their products? I would rather not do this with SQL.
Posted: Dec 16 10 at 16:58
View 2 Replies!
View Related
Str_replace Magento Product Name?
I've got a select input of magento simple products on a grouped product page. I want to remove the grouped product name and leave the rest of the SKU. e.g. simple product name: trfu00XS grouped product name: trfu00 result: XS Have a look below. <form> <select id="tflitem" onchange="showSelected()" /> <option value="" selected>Size</option> <?php if (count($_associatedProducts)): ?> <?php foreach ($_associatedProducts as $_item): ?> <?php if ($_product->isSaleable()): ?> <?php if ($_item->isSaleable()) : ?> [Code]...
Posted: Jul 13 at 15:04
View 2 Replies!
View Related
Magento - Using Mage To Edit A Product?
I'm trying to integrate some functionality of Magento into my custom CMS to make it easier for my clients to update some of their products.I already have classes written to retrieve all the data information I need, but I'm trying to figure out how to save changes to a product in the same fashion (IE, attributes such as color, size, packaging). Is this possible to do through mage?Right now I essentially construct a class like below, then have various functions to filter products, sessions, and generate thumbnails... but I can't seem to find anything on editing a product. Mage::app(); $this->model = Mage::getModel('catalog/product');
Posted: Jul 13 10 at 14:46
View 2 Replies!
View Related
Add Option Value To Product, Then To Cart With Magento?
I searched around for a while and only came up wit solutions that added whole new option sets to products in a Magento store. What I'm trying to accomplish is a way to add a Simple Product to the cart. This Simple Product has some predifined custom options (free text fields) that has to be filled by a php function.So, how can I do this? Let's say I have a product with the ID "111" and a one custom option. $qty = '1'; $product = Mage::getModel('catalog/product')->load("111"); // set option value in product model? $cart = Mage::helper('checkout/cart')->getCart(); $cart->addProduct($product, $qty); // set option value while passing product to car? $cart->save();
Posted: Jan 25 at 12:29
View 1 Replies!
View Related
Magento Configurable Product Attributes?
having an issue with magento which i just cant seem to find a solution to.i have tried many ways of getting a configurable products attributes (simple products) and listing them, now i have them listing from 2 ways but the way im working with is below [Code]... my only problem with this now is i need to only pull back the size attributes which are in stock - looked through mage files to find solution but just cant see anything - the result i need is done in config product php file but i cant access it from in the code where i need to list the size attribute.
Posted: Feb 11 at 11:28
View 1 Replies!
View Related
Magento: Find Orders Containing A Product?
Is there a way in Magento to find all orders that contain a given product? It would be even better if it could be done from the administration panel. Reports -> Products -> Products Ordered gives me the day the product was sold and how many orders contain it, but I need to know which specific orders include the product.
Posted: Jan 12 at 14:05
View 1 Replies!
View Related
Magento Product Insert Method?
in product save in magento this code not save the products. please find the solution of this problem: <?php define('MAGENTO_MAGE_LOCATION','/home/admin/domains/public_html/importcsv1/app/Mage.php'); error_reporting(E_ALL); require_once MAGENTO_MAGE_LOCATION; [code]...
Posted: Oct 1 10 at 6:46
View 2 Replies!
View Related
Have A Bundled Configurable Product In Magento
Is it possible to have a bundled configurable products in Magento? Take for example I want to sell a set of t-shirt and short on a product page where the customer can choose the number of quantity, the color and the size for the t-shirt and short respectively. Maybe like this : T-Shirt [A configurable Product] Color : [combobox to select color] Size : [combobox to select Size] Qty : [input to enter the qty] Short [Another configurable Product] Color : [combobox to select color] Size : [combobox to select Size] Qty : [input to enter the qty] [Add to Cart Button]
Posted: Jun 1 10 at 5:21
View 3 Replies!
View Related
Magento : Using GetModel To Get Product And Category?
I have some code that returns an array of product details including a url_path. To create a link to this product I have to know the category and subcategory of the product. Unfortunately out all the data this method returns neither the category or sub category are pulled out.Here is the code I have that gets a product: $product_id = array(231, 230,229,228); foreach ($product_id as $id){ $productDetails = Mage::getModel('catalog/product')->load($id)->getData(); echo $productDetails['url_path'].'<br />'; } Is it possible to get the category and subcategory for each product?
Posted: Jan 12 at 11:26
View 2 Replies!
View Related
Translate Product Name And Info In Magento?
Magento provide translation feature, a nice one for e-commerce platform. But it seems to me that the translation is only for the predefined magento keyword, like 'add to cart', 'add to wishlist' etc and not for the product name, info, and description that the user input to the store.
Posted: May 14 10 at 4:07
View 2 Replies!
View Related
Magento Configure A Product While Comparing?
I'd like to add some functionality to the comparing feature Magento offers. When comparing products, users are presented with an 'Add to cart' button. This feature only works well for simple products. When pressing the add to cart button on a configurable or bundled product the user is redirected to the product detail, out of the compare view. Would it not be much better when a user could configure the products inside the compare view?! Do you guys know of a magento plugin that does this trick? Or have ideas how this feature could be implemented in the existing source?
Posted: Mar 17 at 13:55
View 1 Replies!
View Related
Create A Downloadable Product Through Magento API?
I am new to Magento, and are using their API. What I want to ask, is it possible to create a downloadable product through the API? The documentation example is just for creating a new simple product, and if I use the API to view the product.info of a downloadable product, I don't see any attribute that link to a downloadable file assigned to that product.
Posted: Mar 4 10 at 3:18
View 1 Replies!
View Related
Add New Product Image Type (Attribute) In Magento
I am trying to add a new image type in the product admin panel. I created a new attribute (hero_banner) set it's type to media image (similar to how the thumbnail image and small_image have been set up). I then added it to the Default attribute set under images. It appears fine in the admin panel and allows you to assign images as the hero but then when I try and echo the image path into the phtml the templates stop rendering. The code I am using to echo the image is below: <?php echo $this->helper('catalog/image')->init($_product, 'hero_banner'); ?> This is being done within a product foreach iteration so I have the $_product variable and I am able to echo other images fine (such as thumbnail, small_image etc).
Posted: Mar 23 at 10:24
View 1 Replies!
View Related
Magento Bundle Product Displaying As Out Of Stock?
I have created a bundle product in Magento 1.4.0.1. All the components of the bundle are in stock but when the bundle is displayed on the front end, it shows as out of stock? How do I get that product to display "in stock"? In the admin system, there isn't an option to add inventory for the bundle, so I guess the stock level is worked out from the component parts (if at all?) - perhaps using the lowest stock count of a component item as the basis for the stock level of the entire bundle? I really don't want that to happen (if it is?). I just need the bundle to display as in stock.
Posted: Dec 16 10 at 9:48
View 2 Replies!
View Related
Changing Product Options Layout In Magento?
How do you change the layout of the product options box? I have created a Configurable product with color options. I notice that Magento demo store doesnt display the product options consistently. My options box appears spanning the entire column for what is just a 1 character choice. I would like the options to display at the very least like this product:[URL]..
Posted: Nov 15 10 at 17:53
View 2 Replies!
View Related
Create Coupon On Specific Product In Magento?
Let's say I have 10% off coupon code. This coupon is applicable only to Product B A customer have in its cart : Product P1 Product B Product P2 I don't want my 10% off coupon apply to other product but only to Product B. Do you know how I can do that within Magento?
Posted: Mar 17 at 11:20
View 2 Replies!
View Related
If/else In Magento Product Custom Option Section?
I want to know if magento has the following option in the custom options section of each product:I have a logo upload option which we have a setup fee of £20, as this isn't a recurring fee i dont want the user to pay multiple times so basically the function to say:if client doesn't have a logo uploaded or on file with us then show logo option (another option within custom options section) and add the price associated with this option to total else do not show this option.
Posted: Jun 13 at 10:01
View 1 Replies!
View Related
Magento Get Product Information On View Page?
This is probably a very easy question. (many of mine seem to be)But how do you get basic productinformation to be echo'd on product view page. Here are the things I am trying to access: Inventory Stock Quantity Restock Date Essentialy I'm looking for something like <?php echo $_product->getQty(); ?> Except that would only give the in cart quantity, but it doesn't even work.
Posted: Jul 6 at 22:22
View 3 Replies!
View Related
Magento: Set And Store A Global Product Filter
In Magento, how can layered navigation selection be kept when a new category is selected or a search is performed? Full story: We're developing a store which sells Books and eBooks. When I am navigating the store I generally want to see all products. I also want to be able to view a category and only see the Books or the eBooks exclusively. That can be easily achieved with an attribute "Product Type" and Layered Navigation. However, the problem is that if I select another category or perform a search, the current layered navigation filter is lost. I have to select the "Product Type" filter again. What are my options if I want to keep the layered navigation across multiple requests? how to best organize my catalog if what I want can't be easily achieved with layered navigation? Would two top level categories for Books and eBooks be a better solution? But then how could I select the "Romance" category and still see Books and eBooks?
Posted: Mar 17 at 11:02
View 1 Replies!
View Related
Display ALL Categories That A Product Belongs To In Magento?
I am conceptualizing a new Magento site which will have products that are included in several categories. What I am wondering is if I can display all categories a product is in on the product detail page. I know that it is possible to get the category, but is it possible to display a list of all categories which a product belongs to? For example, a shirt may be included in the Shirts category, as well as in Designers and Summer. Ideally, I would like to be able to display the following: More from: Men > Shirts Men > Designers > Barnabé Hardy Men > Summer
Posted: Nov 23 10 at 3:39
View 2 Replies!
View Related
Magento Get A Product Collection In An Arbitrary Order?
I have developed a custom search engine for our Magento store and I am trying to load the product collection in a very specific order (I have ranked the results according to an algorithm I designed). I can load the product collection correctly, however it is not in the order that I would like it to be in. Here is basically how it is working now: My database query basically comes back with a PHP array of product IDs. For this example lets say it looks like this: $entity_ids = array(140452, 38601 ); Now I can transpose the 140452 and the 38601 and the product collection comes back in the same order each time. I would like the product collection to be in the same order as the ID of the entity ids. The code I am using to create my collection is as follows: $products = Mage::getModel('catalog/product') ->getCollection() ->addAttributeToSelect('*') ->addAttributeToFilter('entity_id', array('in' => $entity_ids)) ->setPageSize($results_per_page) ->setCurPage($current_page) ->load(); Is there a way to set the sort order to be the order of the $entity_ids array?
Posted: Oct 21 10 at 17:34
View 2 Replies!
View Related
Magento Product Watermarks Not Appearing Transparent
I have a Magento ver. 1.3.3.0 install, I am having a problem with the transparency of product watermarks. The watermark is a .png file but when it is viewed on the product it loses its transparency and has a solid white background. The products on the shop are a wildlife artists paintings so this is really spoiling the artwork. Has anyone experienced this with 1.3.3.0? Upgrading at this stage is not really an option as the site needs to go live soon.
Posted: Sep 28 10 at 8:54
View 2 Replies!
View Related
In Magento - Filter A Product Collection By The Manage_stock Field?
I've built an inventory update script - where I fetch a product collection in Magento, and iterate through the result set, updating product inventory (based on a separate inventory feed) as I go.I can fetch the product collection no problem.However, I only want to get products which have the "Manage Stock" field (a dropdown in the admin under the "inventory" tab) set to "yes". So I tried: // get all magento catalog products with "manage stock" field set to yes $items = Mage::getModel('catalog/product')->getCollection(); $items[code]... But, getting an error: Invalid attribute name: manage_stock.
Posted: Sep 23 10 at 0:37
View 1 Replies!
View Related
|