Virtuemart - 需要我的 AddtoCart 表格才能仅向儿童展示额外的 ID 产品
我正在尝试建立一家销售 DVD、VHS、CD 和数字产品的在线商店。数字产品将分为单件。
我创建了两 (2) 个产品父级:“产品”和“产品单曲” “产品”有三 (3) 个子项:“DVD”、“CD”和“下载” “Product Singles”有三 (4) 个子项:“Track1”、“Track2”、“Track3”和“Track4”
在“Product”的额外 ID 字段中,我输入“Product Singles”的产品 ID。
现在,我的 AddtoCart 表格列出了所有七 (7) 个孩子。
我创建了第二个名为 addtocart_form2.tpl.php 的 AdtoCart 表单,它是 addtocart_form.tpl.php 的精确副本。
在 ps_product_attribute.php 文件中,我创建了一个名为 list_attribute_list2 的重复函数,它控制 AddtoCart 表单中显示的列表。
我的 Flypage 在右上角显示了 addtocart_form.tpl.php,并屏蔽了添加额外 ID 的代码。它起作用了。
我的 Flypage 显示在底部的 addtocart_form.tpl.php 。它起作用了。
现在,我想更改 addtocart_form2.tpl.php 上的代码,以允许仅显示额外的 ID 子项。
但这就是我陷入困境的地方,我不知道如何更改代码以仅显示额外的 ID 子项而不是父“产品”的子项。
任何帮助将不胜感激。
I am attempting to make an online store that sells DVDs, VHSs, CDs and Digital Products. The Digital Products will be broken down into singles.
I have created two (2) Product Parents: "Product" and "Product Singles"
"Product" has three (3) Children: "DVD", "CD" and "Download"
"Product Singles" has three (4) Children: "Track1", "Track2", "Track3" and "Track4"
In "Product"s Extra IDs field I input the Product ID of "Product Singles".
Now, my AddtoCart Form is listing all seven (7) Children.
I created a 2nd AdtoCart Form titled addtocart_form2.tpl.php which is an exact copy of addtocart_form.tpl.php
In the ps_product_attribute.php file, I created a duplicate function called list_attribute_list2 which controls the list that appears in the AddtoCart Form.
I had my Flypage show addtocart_form.tpl.php in the top right and blocked out the code that would add the Extra IDs. It worked.
I had my Flypage show addtocart_form.tpl.php at the bottom. It worked.
Now, I'd like to change the code on addtocart_form2.tpl.php to allow for ONLY the Extra ID Children to appear.
But this is where I'm stuck, I don't know how to change the code to ONLY show the Extra IDs Children and NOT the Parent "Product"s Children.
Any help would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 shop.product_details.php 文件中:
我创建了变量
$q
的第二个实例,并在
$db_product->query( $ q );
在数据库上运行查询,$db_product
现在设置为整行,其中 'product_id' =$product_id
然后我插入了以下代码:
换句话说,我以字符串形式获取“child_option_ids”,然后创建一个数组。然后,我将数组中的第一个数字传输到
$product_id2
。之后,我几乎只是复制了
$product_id
重要的任何内容。如果您需要更多帮助,我想只需发表评论,剩下的我会写,但这是我遇到的主要问题。
In the shop.product_details.php file:
I created a second instance of the variable
$q
and caled it$q2
after
$db_product->query( $q );
ran the query on the Database,$db_product
was now set as the entire row where 'product_id' =$product_id
Then I inserted the following code:
In other words, I fetched 'child_option_ids' as a string, then created an array. Then, I transferred the first number in the array to
$product_id2
.After that, I pretty much just made copies of anything where
$product_id
was important.If you need more help, I guess just comment and I'll write the rest, but this was the main problem I was having.