doumo0206 2016-03-29 13:40
浏览 54

链接到不同类别wordpress woocommerce中相同产品的按钮

I'm looking for someone who can help me out with a problem I'm running into at the moment. I am trying to add a link onto my product page which redirects the user to the same product but under another category:

We have 2 different Bannersets for sale:

productname: Testproduct 1
productcategory: Static bannerset
info: A bannerset that exists of 7 sizes with a JPG extension

productname: Testproduct 1
productcategory: Interactive bannerset
info: A bannerset that exists of 7 formats in .jpg + HTML5 extension

now, on each individual productpage I want a link (basic html href link or button doesn't really matter) that redirects the customer to the same product but in the other category. for instance:

On the static bannerset product page I want a link that says:
I would like this product in the interactive version.
now if you click on this link, I want the customer to be redirected FROM the current url: http://examplesite.com/shop/static-banners/testproduct-1 TO: http://examplesite.com/shop/interactive-banners/testproduct-1

Is there any way to do this?
I already tried fiddling around with some php codes but I only managed to get the permalink and not change the url ...

I hope my explanation was clear enough to understand.

Thanks in advance,

Joost

  • 写回答

2条回答 默认 最新

  • dousi4900 2016-03-29 16:37
    关注
    <a href="<?php echo home_url(); ?>/shop/interactive-banners/<?php echo $post->post_name; ?>">
    

    -add this inside the loop in your product template

    评论

报告相同问题?

悬赏问题

  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 unity第一人称射击小游戏,有demo,在原脚本的基础上进行修改以达到要求
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line