Magento - Db Query To Get Full Product URLs?

May 11, 2011

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


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


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:


I really like to try and leave modifications off the template file.

View 3 Replies

Displaying All Attributes On The Simple Product Table Of A Grouped Product - Magento

I'd like to show all the attributes of a simple product in the grouped product view.

Is there any easy way to do this?

echo $this->htmlEscape($_item->getAttName() works, but then I would have to edit the file every time I had a new attribute, not to mention it would bloat the code if dozens of attributes exist.

Is there anything set up on magento to do this without much hassle?

View 1 Replies

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:


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.

View 4 Replies

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;
$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);........

View 3 Replies

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();
->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 :)

View 2 Replies

Get All Product Collection Order By Product Name In Magento?

I want to get the product collection order by product name in magento?

View 2 Replies

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

View 2 Replies

Get Product Id In Magento?

In magento,i want to add quick look feature like this 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.

View 1 Replies

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.

View 2 Replies

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.

<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()) : ?>


View 2 Replies

Magento Pdf Download For Product?

I need to include a pdf icon within my product details page so they can download it as a summary, ideally using the print.css

View 1 Replies

Replacement For # Sign In Product Data For SEF Urls?

I created Search engine friendly (SEF) urls paged on a product database. My function however was rendered useless when I discovered some product entries that contained the "#" or pound sign. What is a good replacement for the "#" sign when making SEF urls?

View 4 Replies

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.

$this->model = Mage::getModel('catalog/product');

View 2 Replies

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?

View 1 Replies

Add A Simple Product Into Magento Using A Function?

How have I to add a product into Magento using a php function? I have used the API but it is very slow. I have to import about 100.000 records and check the stock everynight.

View 1 Replies

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


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.

View 1 Replies

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.

View 1 Replies

Magento Product Insert Method?

in product save in magento this code not save the products. please find the solution of this problem:


View 2 Replies

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]

View 3 Replies

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?

View 2 Replies

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.

View 2 Replies

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?

View 1 Replies

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 of a downloadable product, I don't see any attribute that link to a downloadable file assigned to that product.

View 1 Replies

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).

View 1 Replies

Magento With Calling IsInStock() Method On A Product

I want to check if some products are in stock but whatever I do the isInStock() method always returns TRUE. My products are configurable products with no associated products and under the "Inventory" tab "Stock Availability" is set to "Out of Stock".

View 1 Replies

Copyrights 2005-15, All rights reserved