Foros: osCommerce FAQ (Thread #30063)

FacebookソーシャルプラグインのURL自動取得について (2011-08-07 15:21 by backy #59003)

みなさんこんにちは

運用しているosCommerceの各商品ページにfacebookの「いいね!」ボタンや
「コメント」を挿入したいと考えています。

Facebook DEVELOPERSのプラグインページで自分のURLなど入力すると以下の
ようなコード(以下は、コメント)を書きだしてくれますが、、、

<div id="fb-root"></div><script src="http://connect.facebook.net/ja_JP/all.js#xfbml=1"></script><fb:comments href="http://example.com/" num_posts="2" width="550"></fb:comments>

このままだと例えば、以下のように商品ページ毎にURLを書き換えながら張り
つけていかなければなりません。

<div id="fb-root"></div><script src="http://connect.facebook.net/ja_JP/all.js#xfbml=1"></script><fb:comments href="http://example.com/product_info.php/products_id/4254" num_posts="2" width="550"></fb:comments>


そこで、例えば以下のように自動生成してくれる呪文があればと思い投稿させて
いただきました。


自動生成されたソースの次の部分を

href="example.com"

たとえば、こんな感じの独自タグを追加することで自動生成できないかと。。。

href="http://example.com/<{$product_link}>"


このことで、各商品ページごとにコメント欄を設けることができ、その商品
ごとにコメントの読み書きができます。

他のショッピングカートや、wordpressなどのブログにはすでにこのような
対応がなされているようなので、osCommerceでも求められる方が多いのでは
ないかと思われます。

プログラムなどすごく素人なので、幼稚な質問なのかもしれませんが
どなたかご教授をいただけますようお願いいたします。

Responder al #59003×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Entrar

RE: FacebookソーシャルプラグインのURL自動取得について (2011-08-09 10:39 by Anónimo #59048)

こんな感じでいいのかな?

<?php echo '<div id="fb-root"></div><script src="http://connect.facebook.net/ja_JP/all.js#xfbml=1"></script><fb:comments href="' . tep_href_link(FILENAME_PRODUCT_INFO, "products_id=" . (int) $HTTP_GET_VARS["products_id"],NONSSL,false) . '" num_posts="2" width="550"></fb:comments>' . "\n"; ?>
Responder al #59003

Responder al #59048×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Entrar

RE: FacebookソーシャルプラグインのURL自動取得について (2011-08-10 19:48 by backy #59058)

早速、ありがとうございます!

試してみたのですが、表示がうまくできないようです。

href="http://example.com/の後ろに呪文をつけるだけで

product_info.php/products_id/***

が取得できるような虫の良い方法はないものでしょうか。






Responder al #59003

Responder al #59058×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Entrar

RE: FacebookソーシャルプラグインのURL自動取得について (2011-08-11 13:38 by Anónimo #59090)

<?php echo DIR_WS_CATALOG . FILENAME_PRODUCT_INFO . "/products_id/" . (int) $HTTP_GET_VARS["products_id"]; ?>
Responder al #59058

Responder al #59090×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Entrar

RE: FacebookソーシャルプラグインのURL自動取得について (2011-08-12 18:35 by Anónimo #59117)

もう

<?php echo $HTTP_GET_VARS["products_id"]; ?>

でいいだろあとは定数なんだから。

というかもう答えは出てるはずなんだけど
うまくできないとか言い出すのがわけわかめ。
Responder al #59090

Responder al #59117×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Entrar