Skip to main content
added 89 characters in body
Source Link
Robert
  • 2.2k
  • 3
  • 37
  • 84

I have configurable product create with attribute size, I try to list this attribute size in the product description, but addAttributeToSort() not working. My code is:

if($_product->getTypeId() == "configurable"):
    $conf = Mage::getModel('catalog/product_type_configurable')->setProduct($_product);

    $simple_collection = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addAttributeToSort('size','ASC')->addFilterByRequiredOptions();

right now I have something like this:

100g
10g
25g

enter image description here

If I use DESC instead ASC I have this sorting:

25g
10g
100g

The entire code:

if($_product->getTypeId() == "configurable"):
    $conf = Mage::getModel('catalog/product_type_configurable')->setProduct($_product);

    $simple_collection = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addAttributeToSort('size','ASC')->addFilterByRequiredOptions();
    foreach($simple_collection as $simple_product){
        echo $simple_product->getAttributeText('size');
    }
endif;

enter image description here

I have configurable product create with attribute size, I try to list this attribute size in the product description, but addAttributeToSort() not working. My code is:

if($_product->getTypeId() == "configurable"):
    $conf = Mage::getModel('catalog/product_type_configurable')->setProduct($_product);

    $simple_collection = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addAttributeToSort('size','ASC')->addFilterByRequiredOptions();

right now I have something like this:

100g
10g
25g

enter image description here

If I use DESC instead ASC I have this sorting:

25g
10g
100g

The entire code:

if($_product->getTypeId() == "configurable"):
    $conf = Mage::getModel('catalog/product_type_configurable')->setProduct($_product);

    $simple_collection = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addAttributeToSort('size','ASC')->addFilterByRequiredOptions();
    foreach($simple_collection as $simple_product){
        echo $simple_product->getAttributeText('size');
    }
endif;

I have configurable product create with attribute size, I try to list this attribute size in the product description, but addAttributeToSort() not working. My code is:

if($_product->getTypeId() == "configurable"):
    $conf = Mage::getModel('catalog/product_type_configurable')->setProduct($_product);

    $simple_collection = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addAttributeToSort('size','ASC')->addFilterByRequiredOptions();

right now I have something like this:

100g
10g
25g

enter image description here

If I use DESC instead ASC I have this sorting:

25g
10g
100g

The entire code:

if($_product->getTypeId() == "configurable"):
    $conf = Mage::getModel('catalog/product_type_configurable')->setProduct($_product);

    $simple_collection = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addAttributeToSort('size','ASC')->addFilterByRequiredOptions();
    foreach($simple_collection as $simple_product){
        echo $simple_product->getAttributeText('size');
    }
endif;

enter image description here

added 467 characters in body
Source Link
Robert
  • 2.2k
  • 3
  • 37
  • 84

I have configurable product create with attribute size, I try to list this attribute size in the product description, but addAttributeToSort() not working. My code is:

if($_product->getTypeId() == "configurable"):
    $conf = Mage::getModel('catalog/product_type_configurable')->setProduct($_product);

    $simple_collection = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addAttributeToSort('size','ASC')->addFilterByRequiredOptions();

right now I have something like this:

100g
10g
25g

enter image description here

If I use DESC instead ASC I have this sorting:

25g
10g
100g

The entire code:

if($_product->getTypeId() == "configurable"):
    $conf = Mage::getModel('catalog/product_type_configurable')->setProduct($_product);

    $simple_collection = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addAttributeToSort('size','ASC')->addFilterByRequiredOptions();
    foreach($simple_collection as $simple_product){
        echo $simple_product->getAttributeText('size');
    }
endif;

I have configurable product create with attribute size, I try to list this attribute size in the product description, but addAttributeToSort() not working. My code is:

if($_product->getTypeId() == "configurable"):
    $conf = Mage::getModel('catalog/product_type_configurable')->setProduct($_product);

    $simple_collection = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addAttributeToSort('size','ASC')->addFilterByRequiredOptions();

right now I have something like this:

100g
10g
25g

enter image description here

If I use DESC instead ASC I have this sorting:

25g
10g
100g

I have configurable product create with attribute size, I try to list this attribute size in the product description, but addAttributeToSort() not working. My code is:

if($_product->getTypeId() == "configurable"):
    $conf = Mage::getModel('catalog/product_type_configurable')->setProduct($_product);

    $simple_collection = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addAttributeToSort('size','ASC')->addFilterByRequiredOptions();

right now I have something like this:

100g
10g
25g

enter image description here

If I use DESC instead ASC I have this sorting:

25g
10g
100g

The entire code:

if($_product->getTypeId() == "configurable"):
    $conf = Mage::getModel('catalog/product_type_configurable')->setProduct($_product);

    $simple_collection = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addAttributeToSort('size','ASC')->addFilterByRequiredOptions();
    foreach($simple_collection as $simple_product){
        echo $simple_product->getAttributeText('size');
    }
endif;
added 89 characters in body
Source Link
Robert
  • 2.2k
  • 3
  • 37
  • 84

I have configurable product create with attribute size, I try to list this attribute size in the product description, but addAttributeToSort() not working. My code is:

if($_product->getTypeId() == "configurable"):
    $conf = Mage::getModel('catalog/product_type_configurable')->setProduct($_product);

    $simple_collection = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addAttributeToSort('size','ASC')->addFilterByRequiredOptions();

right now I have something like this:

100g
10g
25g

enter image description here

If I use DESC instead ASC I have this sorting:

25g
10g
100g

I have configurable product create with attribute size, I try to list this attribute size in the product description, but addAttributeToSort() not working. My code is:

if($_product->getTypeId() == "configurable"):
    $conf = Mage::getModel('catalog/product_type_configurable')->setProduct($_product);

    $simple_collection = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addAttributeToSort('size','ASC')->addFilterByRequiredOptions();

right now I have something like this:

100g
10g
25g

I have configurable product create with attribute size, I try to list this attribute size in the product description, but addAttributeToSort() not working. My code is:

if($_product->getTypeId() == "configurable"):
    $conf = Mage::getModel('catalog/product_type_configurable')->setProduct($_product);

    $simple_collection = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addAttributeToSort('size','ASC')->addFilterByRequiredOptions();

right now I have something like this:

100g
10g
25g

enter image description here

If I use DESC instead ASC I have this sorting:

25g
10g
100g
Source Link
Robert
  • 2.2k
  • 3
  • 37
  • 84
Loading