test
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • calavaro Friend
    #190620

    Hi,

    “Recommend to friend” function is missing from product details view.
    I have it enabled in Virtuemart back end, but it does not show on front end at all (no matter what I try).

    What is the solution to get this to display?

    Thank you.

    Back end.

    Front end.


    1. 9rgmbgV
    2. pg7dKO4
    phong nam Friend
    #506080

    Hi calavaro,

    On the JA Hawkstore template, we hide this icon on the product details layout. Anwways, you can display this emai icon by openning templatesja_hawkstorehtmlcom_virtuemartproductdetailsdefault.php file at 248th line, insert these codes:

    <?php
    // PDF - Print - Email Icon
    if (VmConfig::get('show_emailfriend') || VmConfig::get('show_printicon') || VmConfig::get('pdf_button_enable')) {
    ?>
    <div class="icons">
    <?php
    //$link = (JVM_VERSION===1) ? 'index2.php' : 'index.php';
    $link = 'index.php?tmpl=component&option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $this->product->virtuemart_product_id;
    $MailLink = 'index.php?option=com_virtuemart&view=productdetails&task=recommend&virtuemart_product_id=' . $this->product->virtuemart_product_id . '&virtuemart_category_id=' . $this->product->virtuemart_category_id . '&tmpl=component';

    if (VmConfig::get('pdf_icon', 1) == '1') {
    echo $this->linkIcon($link . '&format=pdf', 'COM_VIRTUEMART_PDF', 'pdf_button', 'pdf_button_enable', false);
    }
    echo $this->linkIcon($link . '&print=1', 'COM_VIRTUEMART_PRINT', 'printButton', 'show_printicon');
    echo $this->linkIcon($MailLink, 'COM_VIRTUEMART_EMAIL', 'emailButton', 'show_emailfriend');
    ?>
    <div class="clear"></div>
    </div>
    <?php } // PDF - Print - Email Icon END
    ?>

    Then create a custom.css file at templates/ja_hawkstore/css/ path and put below codes into:

    .icons {
    position: absolute;
    right: 150px;
    top: 490px;
    }

    calavaro Friend
    #506278

    Hi,

    It worked very well. Thank you very much.

    If you have time, not urgent and only for my own knowledge, could you let me know how to turn the icon to a text line?
    Alternatively how to change the pop-up text from “Email” to recommend to friend.

    Edit: Although I had to insert the PHP code at line 70 to get it to show up at the top right, next to the ratings.

    Edit2: I also had to add another snippet of CSS to custom.css for it to display right on any device 480px or smaller (eg for modern mobiles with 1080x1920px screens). This code is shown below.

    @media (max-width: 480px) {
    .icons {
    position: absolute;
    right: 25px;
    top: 530px;
    }

    All the best,

    Calavaro

    phong nam Friend
    #506349

    Hi Calavaro,

    In order to change the mail icon into the texts, you will need to customize the VM core file. So that i suggest you to backup and open componentscom_virtuemarthelpersvmview.php, find 37th line:

    if ($modal) return '<a class="modal" rel="{handler: 'iframe', size: {x: 700, y: 550}}" title="'. JText::_($altText).'" href="'.JRoute::_($link, FALSE).'">'.$text.'</a>';

    Change the $text to ‘Recommend friend’.

    On the first concern, i missed to give css styles on mobile/tablet view 🙂

    calavaro Friend
    #506372

    Hi Leo,

    Thanks for replying once again.
    You pointed me in the right direction and the right line, however, the correct snippet of code to change was not $text.
    The correct snippet was as below
    "'. JText::_($altText).'"
    Changed to "Recommend to friend"

    This displays right.

    All the best,

    Calavaro

Viewing 5 posts - 1 through 5 (of 5 total)

This topic contains 5 replies, has 2 voices, and was last updated by  calavaro 11 years, 2 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum