How to make dynamic Product URL key in phtml file for magento shop

Sharon Hu Bach

I want to make a "shop online" link on the B2B Magento shop product page (http://b2b.com/product1/) to redirect visitors to the B2C shop product page like: http://b2c.com/product1/

I only know that <?php echo $_product->getProductUrl() ?> is calling http://b2b.com/product1/ But how to call a dynamic URL key in the /product/view.phtml, so then in the URL structure only the domain is changed from b2b.com to b2c.com but the product key will stay the same according to which product is being viewed?

Sharon Hu Bach

Okay, I found a solution that is exactly what I want to achieve:

<a href="http://google.com/<?php $_product = Mage::getModel('catalog/product')->load($_product->getId()) ?><?php echo $_product->getUrlKey(); ?>">ProductName</a>

Then the URL link will be shown as google.com/ProductName

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

How to give product images external url in magento 1.9.0.1

분류에서Dev

Magento Category Widget in phtml

분류에서Dev

Magento shop language switch

분류에서Dev

magento에서 .phtml에서 URL을 만드는 방법

분류에서Dev

how to redirect the URL in magento?

분류에서Dev

Parse .phtml file in Java

분류에서Dev

how to get category name of current product (on product detail page) in magento

분류에서Dev

Magento - passing params in URL to template file

분류에서Dev

Magento Shop 언어 스위치

분류에서Dev

How to recover Windows Vista product key?

분류에서Dev

Magento의 왼쪽 열 phtml 파일

분류에서Dev

Magento 2 phtml 파일의 조건문

분류에서Dev

Magento 시스템 로그에서 "유효하지 않은 템플릿 파일 : frontend / base / default / template / catalog / product / categorymenu.phtml"오류가 발생합니다.

분류에서Dev

product / view.phtml에서 product / view / description.phtml로 childhtml을 이동합니다.

분류에서Dev

Where should i look for file from ajax call url [Magento]

분류에서Dev

Creating product page tabs in magento

분류에서Dev

Magento Shop의 SQL 교체 기능

분류에서Dev

How to make a .sqfs file

분류에서Dev

How to obtain Product Key from Visusal Studio Professional 2012?

분류에서Dev

How do I tell if a Windows 8.1 Product Keys is an OEM key?

분류에서Dev

C : How to make the size of an array dynamic?

분류에서Dev

How to download a URL as a file?

분류에서Dev

How to make another key instead of replacing it in firebase

분류에서Dev

How to make a list as a key of dict in Python?

분류에서Dev

How to make sure only one key is pressed

분류에서Dev

Magento-view.phtml에서 제품 항목 속성 가져 오기

분류에서Dev

magento go에서 새 phtml 생성이 허용됩니까?

분류에서Dev

Magento : 제품 페이지에 스크립트 phtml 추가

분류에서Dev

phtml 파일의 Magento 고객 계정 링크

Related 관련 기사

  1. 1

    How to give product images external url in magento 1.9.0.1

  2. 2

    Magento Category Widget in phtml

  3. 3

    Magento shop language switch

  4. 4

    magento에서 .phtml에서 URL을 만드는 방법

  5. 5

    how to redirect the URL in magento?

  6. 6

    Parse .phtml file in Java

  7. 7

    how to get category name of current product (on product detail page) in magento

  8. 8

    Magento - passing params in URL to template file

  9. 9

    Magento Shop 언어 스위치

  10. 10

    How to recover Windows Vista product key?

  11. 11

    Magento의 왼쪽 열 phtml 파일

  12. 12

    Magento 2 phtml 파일의 조건문

  13. 13

    Magento 시스템 로그에서 "유효하지 않은 템플릿 파일 : frontend / base / default / template / catalog / product / categorymenu.phtml"오류가 발생합니다.

  14. 14

    product / view.phtml에서 product / view / description.phtml로 childhtml을 이동합니다.

  15. 15

    Where should i look for file from ajax call url [Magento]

  16. 16

    Creating product page tabs in magento

  17. 17

    Magento Shop의 SQL 교체 기능

  18. 18

    How to make a .sqfs file

  19. 19

    How to obtain Product Key from Visusal Studio Professional 2012?

  20. 20

    How do I tell if a Windows 8.1 Product Keys is an OEM key?

  21. 21

    C : How to make the size of an array dynamic?

  22. 22

    How to download a URL as a file?

  23. 23

    How to make another key instead of replacing it in firebase

  24. 24

    How to make a list as a key of dict in Python?

  25. 25

    How to make sure only one key is pressed

  26. 26

    Magento-view.phtml에서 제품 항목 속성 가져 오기

  27. 27

    magento go에서 새 phtml 생성이 허용됩니까?

  28. 28

    Magento : 제품 페이지에 스크립트 phtml 추가

  29. 29

    phtml 파일의 Magento 고객 계정 링크

뜨겁다태그

보관