- Posts: 303
- Thank you received: 18
Hide Parameter if Product sale date in future
- mojooutdoors-holden
-
Topic Author
- Offline
Less
More
7 years 8 months ago - 7 years 8 months ago #302854
by mojooutdoors-holden
Hide Parameter if Product sale date in future was created by mojooutdoors-holden
-- HikaShop version -- : 3.5.1
I'm trying to conditionally hide a container if the product_sale_start > current date. I should also note, I'm trying to use this on the product/show_default view file.
I tried to mimic what was on the product/quantity view
However, it seems like it's not pulling the product_sale_start data at all? Any thoughts?
I'm trying to conditionally hide a container if the product_sale_start > current date. I should also note, I'm trying to use this on the product/show_default view file.
I tried to mimic what was on the product/quantity view
Code:
<?php
$now = time();
$start_date = (@$this->row->product_sale_start || empty($this->element->main)) ? @$this->row->product_sale_start : $this->element->main->product_sale_start;
$end_date = (@$this->row->product_sale_end || empty($this->element->main)) ? @$this->row->product_sale_end : $this->element->main->product_sale_end;?>
<div style ="<?php if($start_date > 0 && $start_date > $now) echo "display:none";?>">
</div>
<?php
?>
However, it seems like it's not pulling the product_sale_start data at all? Any thoughts?
Last edit: 7 years 8 months ago by mojooutdoors-holden.
Please Log in or Create an account to join the conversation.
7 years 8 months ago #302865
by nicolas
Replied by nicolas on topic Hide Parameter if Product sale date in future
Hi,
Such code should be enough:
Such code should be enough:
Code:
<div style ="<?php if($this->element->product_sale_start > time()) echo "display:none";?>">
</div>
Please Log in or Create an account to join the conversation.
- mojooutdoors-holden
-
Topic Author
- Offline
Less
More
- Posts: 303
- Thank you received: 18
7 years 8 months ago #302909
by mojooutdoors-holden
Replied by mojooutdoors-holden on topic Hide Parameter if Product sale date in future
Ah, I was complicating matters. Thanks for the fix!
Please Log in or Create an account to join the conversation.
Time to create page: 0.163 seconds