1
How do I stop instead:
elseif ( $qtd == 1000 ) {
echo $this->__('<b>produto customizável</b><br><span class="product-name">ENTRE EM CONTATO</span><div style="backgroud:#333">');
}
Make it work that:
elseif ( $qtd == 1000 ) {
echo $this->__('<a class="askproduct popup" href="<?php echo Mage::getUrl('askfordetails/askfordetails', array('product_id' => $_product->getId())) ?>"><?php echo Mage::helper('askfordetails')->__('ENTRE EM CONTATO') ?></a>');
}
Does anyone know if this is possible?
This post is the excerpt of a conditional, that if the stock of a given product is equal to 1,000 is to show on the front a link composed by the base url + /askfordetails/askfordetails/index/product_id/ + the product id
– Thiago Santos
see all code snippet: <? php $Qtd = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product)->getQty(); if ( $Qtd == 0 ) { echo $this->('<span class="product-name">PRODUCT<br>OUT OF STOCK</b>');} elseif ( $Qtd == 1000 ) { echo $this->_('<b>customizable product</b><br><span class="product-name">MAKE CONTACT</span><div style="backgroud:#333">'); } Else { ? > <? php echo $this->getChildHtml('product_type_data') ? > <? php echo $this->getChildHtml('addtocart') ? > <? php } ?>
– Thiago Santos
Why do you keep opening and closing PHP instead of using only one
<?php
up there and a?>
underneath?– Bacco
I’m pretty clueless in PHP, I don’t know why I’m like this. All I know is that I’ve been searching the internet for a solution for this and I can’t find it, I’ve read enough about concatenating php inside echo, but I can’t execute it!! you know how this should look?
– Thiago Santos
He’s so full of trouble, it’s hard to even begin to answer. Look, I rewrote your code in a more normal way, but I didn’t get implementation errors, which depend on the rest of your system: http://pastebin.com/mnPF8Dgw - It would be nice to get at least a basic notion of what you are doing, or even with good answers, you will have trouble applying to your practical case.
– Bacco
Thank you, Bacco. I know that!
– Thiago Santos
In summary, you can give several "echo" in separate lines without concatenating.
echo '1';
echo '2';
echo '3';
even in separate lines will exit 123 on the screen. Or if you prefer, you can use the dot:echo Funcao1() . Funcao2()
concatenation. Another example:echo 'x'.(2+2).'y';
will showx4y
onscreen.– Bacco
This I understood, but I still can’t display it:<a class="askproduct popup" href="<? php echo Mage::geturl('askfordetails/askfordetails', array('product_id' => $product->getId())) ? >"><? php echo Mage::helper('askfordetails')->_('GET IN TOUCH') ? ></a> instead: <b>customizable product</b><br><span class="product-name">CONTACT</span><div style="background:#333">
– Thiago Santos
Edit the question by clicking on [Edit] just below it, put all the details you need, and learn how to format your questions here: http://answall.com/editing-help - Read also [Ask] to be able to improve your posting, thus increases the chance of being able to help.
– Bacco
http://pastebin.com/z4davmkh
– Bacco
It hasn’t worked yet, but anyway, thank you very much Bacco! I’ll study a little about concatenating and breaking the head more. Thanks a lot
– Thiago Santos