osCmax v2.5 User Manual
Results 1 to 2 of 2

Adding e-mail function to review approval contribution

This is a discussion on Adding e-mail function to review approval contribution within the osCmax v2 Customization/Mods forums, part of the osCmax v2.0 Forums category; I just added the "review approval" to my shop. It's for oscommerce but just had to change one extra string ...

      
  1. #1
    New Member
    Join Date
    Aug 2008
    Posts
    7
    Rep Power
    0


    Default Adding e-mail function to review approval contribution

    I just added the "review approval" to my shop. It's for oscommerce but just had to change one extra string to get it to work in osCMax. There's an extra addon to get an e-mail whenever a new review had been added.

    This is the howto on how to do this:
    Code:
     
    Find the following line in product_reviews_write.php(at or near line 51):
          tep_db_query("insert into " . TABLE_REVIEWS_DESCRIPTION . " (reviews_id, languages_id, reviews_text) values ('" . (int)$insert_id . "', '" . (int)$languages_id . "', '" . tep_db_input($review) . "')");
    Insert this code:
      //notify store owner of new review to approve => added by Brian Christensen on 03-16-06
      $subject = 'Product Review';
      $message = 'There is a new product review awaiting approval';
      $from_name = 'Product Reviews';
      $from_email = 'reviews@YOURDOMAIN.com'; //change YOURDOMAIN.com to your store's domain
      tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $subject, $message, $from_name, $from_email);
      //end notify store owner
    right before this line:
          tep_redirect(tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params(array('action'))));
    But my product_reviews_write.tpl.php looks like this:
    PHP Code:
        <?php echo tep_draw_form('product_reviews_write'tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE'action=process&products_id=' $HTTP_GET_VARS['products_id']), 'post''onSubmit="return checkForm();"'); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
              <tr>
                <td class="pageHeading" valign="top"><?php echo $products_name?></td>
                <td class="pageHeading" align="right" valign="top"><?php echo $products_price?></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td><?php echo tep_draw_separator('pixel_trans.gif''100%''10'); ?></td>
          </tr>
    <?php
      
    if ($messageStack->size('review') > 0) {
    ?>
          <tr>
            <td><?php echo $messageStack->output('review'); ?></td>
          </tr>
          <tr>
            <td><?php echo tep_draw_separator('pixel_trans.gif''100%''10'); ?></td>
          </tr>
    <?php
      
    }
    ?>
          <tr>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="2">
              <tr>
                <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
                  <tr>
                    <td class="main"><?php echo '<b>' SUB_TITLE_FROM '</b> ' tep_output_string_protected($customer['customers_firstname'] . ' ' $customer['customers_lastname']); ?></td>
                  </tr>
                  <tr>
                    <td class="main"><b><?php echo SUB_TITLE_REVIEW?></b></td>
                  </tr>
                  <tr>
                    <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
                      <tr class="infoBoxContents">
                        <td><table border="0" width="100%" cellspacing="2" cellpadding="2">
                          <tr>
                            <td class="main"><?php echo tep_draw_textarea_field('review''soft'6015); ?></td>
                          </tr>
                          <tr>
                            <td class="smallText" align="right"><?php echo TEXT_NO_HTML?></td>
                          </tr>
                          <tr>
                            <td class="main"><?php echo '<b>' SUB_TITLE_RATING '</b> ' TEXT_BAD ' ' tep_draw_radio_field('rating''1') . ' ' tep_draw_radio_field('rating''2') . ' ' tep_draw_radio_field('rating''3') . ' ' tep_draw_radio_field('rating''4') . ' ' tep_draw_radio_field('rating''5') . ' ' TEXT_GOOD?></td>
                          </tr>
                        </table></td>
                      </tr>
                    </table></td>
                  </tr>
                  <tr>
                    <td><?php echo tep_draw_separator('pixel_trans.gif''100%''10'); ?></td>
                  </tr>
                  <tr>
                    <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
                      <tr class="infoBoxContents">
                        <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
                          <tr>
                            <td width="10"><?php echo tep_draw_separator('pixel_trans.gif''10''1'); ?></td>
                            <td class="main"><?php echo '<a href="' tep_href_link(FILENAME_PRODUCT_NOTICEtep_get_all_get_params(array('reviews_id''action'))) . '">' tep_image_button('button_back.gif'IMAGE_BUTTON_BACK) . '</a>'?></td>
                            <td class="main" align="right"><?php echo tep_image_submit('button_continue.gif'IMAGE_BUTTON_CONTINUE); ?></td>
                            <td width="10"><?php echo tep_draw_separator('pixel_trans.gif''10''1'); ?></td>
                          </tr>
                        </table></td>
                      </tr>
                    </table></td>
                  </tr>
                </table></td>
                <td width="<?php echo SMALL_IMAGE_WIDTH 10?>" align="right" valign="top"><table border="0" cellspacing="0" cellpadding="2">
                  <tr>
                    <td align="center" class="smallText">
    <?php
      
    if (tep_not_null($product_info['products_image'])) {
    ?>
    <script language="javascript"><!--
    document.write('<?php echo '<a href="javascript:popupWindow('' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '')">' tep_image(DIR_WS_IMAGES $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTHSMALL_IMAGE_HEIGHT'hspace="5" vspace="5"') . '<br>' TEXT_CLICK_TO_ENLARGE '</a>'?>');
    //--></script>
    <noscript>
    <?php echo '<a href="' tep_href_link(DIR_WS_IMAGES $product_info['products_image']) . '" target="_blank">' tep_image(DIR_WS_IMAGES $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTHSMALL_IMAGE_HEIGHT'hspace="5" vspace="5"') . '<br>' TEXT_CLICK_TO_ENLARGE '</a>'?>
    </noscript>
    <?php
      
    }
      echo 
    '<p><a href="' tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now') . '">' tep_image_button('button_in_cart.gif'IMAGE_BUTTON_IN_CART) . '</a></p>';
    ?>
                    </td>
                  </tr>
                </table>
              </td>
            </table></td>
          </tr>
        </table></form>
    I'd like to implement this e-mailing feature into this file but I really don't know how to do it. Someone that got it working already care to explain me how they did it?

  2. #2
    jpf
    jpf is offline
    osCMax Testing Team
    jpf's Avatar
    Join Date
    Sep 2003
    Location
    Manitoba, Canada
    Posts
    2,699
    Rep Power
    22


    Default Re: Adding e-mail function to review approval contribution

    Try looking at the correct file at the instructions suggest:

    Find the following line in product_reviews_write.php(at or near line 51):

    cause as you stated:

    But my product_reviews_write.tpl.php looks like this.....

    I found it no problem.
    JPF - osCMax Fourm Moderator - To contact, post on the forum or click here
    Try out our osCMax at: Live Catalog Demo
    Limited access Admin: Live Admin Demo
    Feel free to add products they way you want and then purchase them -=+=- Sorry nothing will be billed or shipped!

Similar Threads

  1. Review Approval System
    By michael_s in forum New osCommerce Contributions
    Replies: 0
    Last Post: 09-14-2008, 11:12 PM
  2. adding a contribution to bts, is it too complicated?
    By pefc2525 in forum osCmax v2 Customization/Mods
    Replies: 2
    Last Post: 03-25-2006, 09:55 PM
  3. Problems removing Review function
    By InfernoX in forum osCmax v2 Customization/Mods
    Replies: 5
    Last Post: 10-27-2005, 01:56 PM
  4. Adding another contribution
    By stetrk in forum osCmax v1.7 Discussion
    Replies: 2
    Last Post: 01-04-2005, 07:23 PM
  5. Contribution for adding multiple products
    By jacven in forum osCommerce 2.2 Modification Help
    Replies: 3
    Last Post: 10-22-2003, 07:23 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •