Magento 1.9: I am getting the same url in all the products on frontend

  • Open
  • Shiwani
    Participant
    September 6, 2019 at 11:26 am #2937
    Shiwani

    I need to show the related products below the images of all products.
    All data is showing good but the URLs is not correct Its showing same in the first related products

    How can I solve this?

  1. rohit
    Participant
    Posts: 26
    September 9, 2019 at 6:53 am #2956
    rohit

    Can you please share your code what your are implementing ?,  without that it will be very difficult to know what is the issue.

     

     

  2. Pankaj Sharma
    Participant
    Posts: 93
    September 9, 2019 at 10:15 am #2962
    Pankaj Sharma

    Hi Shiwani,

    This issue can be resolved by using $product->getUrlPath() instead of $product->getProductUrl() in the EE of Magento.
    Also, I would like to recommend you to use function addUrlRewrite with your collection.

    $collection->addUrlRewrite();

    Let me know if it wok for you.

    Thanks