Osclass Support Forums
Osclass plugin support => Osclass Pay Plugin => Topic started by: Tango on August 09, 2022, 12:10:47 AM
-
Hello,
I would like to show an icon on the listing page, when that listing is for sale and has shipping enabled.
So what is the function that returns if an item has shipping enabled or not?
I tried something like:
<?php if(function_exists('osp_product_to_cart_link') && osp_param('enable_shipping') == 1 ) { ?>
...
But it shows the icon on all listings, not just for those that have shipping enabled.
Any ideas?
Thanks!
-
@Tango
You must get osp item data record and check if shipping is set to yes.
-
Yeah, I tried the following but with no luck:
$item['fk_i_item_id'] = isset($item['fk_i_item_id']) ? $item['fk_i_item_id'] : 0;
$item_data = ModelOSP::newInstance()->getItemData($item['fk_i_item_id']);
if(isset($item_data['i_shipping']) && $item_data['i_shipping'] == 1) {
...
I don't know what I'm missing...
-
@Tango
Looks good, make sure you are getting item id properly
-
Yeah, I tried the following but with no luck:
$item['fk_i_item_id'] = isset($item['fk_i_item_id']) ? $item['fk_i_item_id'] : 0;
$item_data = ModelOSP::newInstance()->getItemData($item['fk_i_item_id']);
if(isset($item_data['i_shipping']) && $item_data['i_shipping'] == 1) {
...
I don't know what I'm missing...
Hi @tango could you help me I wanted to put an icon on items with shipments too
-
<?php
if(function_exists('osp_install')) {
$item_data = ModelOSP::newInstance()->getItemData(osc_item_id());
if(isset($item_data['i_shipping']) && $item_data['i_shipping'] == 1) { ?>
// Your icon code here
<?php } ?>
<?php } ?>
You can apply this wherever you want.
Good luck!