Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Request Product Reviews


kymation

Recommended Posts

The way I have certain specifications set up, an item can have several values for the same specification name. The code I just showed currently shows like this:

<p><strong>Spec Name 1</strong></p>
<ul class=specification_box>
<li> Spec1 Value 1</li>
</ul>
<p><strong>Spec Name 1</strong></p>
<ul class=specification_box>
<li> Spec1 Value 2</li>
</ul>
<p><strong>Spec Name 2</strong></p>
<ul class=specification_box>
<li> Spec2 Value 1 </li>
</ul>
<p><strong>Spec Name 2</strong></p>
<ul class=specification_box>
<li> Spec2 Value 2 </li>
</ul>

 

Im trying to get it to show the name of the specification once for all the values under that specification name.

Link to comment
Share on other sites

Now I see what's happening. You have multiple values assigned to a specification for each product. The code in products_specifications.php doesn't handle that correctly. It's going to be necessary to split the SQL into two parts: One to get the name, and the second to loop through and get all of the values. This is going to take a bit of work. Unfortunately I don't have a lot of time to work on this right now. I'll see what I can do in a day or two.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Oh, even more complicated than I had thought. Well time is not an issue with me as Im still far from being live. If you get time to look at it I would appreciate it but don't make it a priority.

 

Thanks!

Link to comment
Share on other sites

  • 2 months later...

Another potential fix for blank emails when the script is run by a CRON Job is to change the line:

 

$text_file = basename ($PHP_SELF, ".php") . '.tpl';

 

to:

 

$text_file = 'review_mail.tpl';

 

Assuming the template file resides in the same folder as the script and the filename has not been changed.

 

This fixed my problem completely.

 

Garry.

Garry

Link to comment
Share on other sites

  • 9 months later...
  • 1 month later...

Hi there,

 

I've just installed this and have it working but I'd like to send it to customers who have ordered in the last 30 days. At the moment, as per the instructions, all orders have a reminder_set status of 1

 

What I want to do it make that 0 for orders < 30 days old

 

So something like this UPDATE orders SET reminder_sent = 0 where last_modified <= date/ time

 

Any ideas how to finish it off :)

 

Thanks

 

Dave

Link to comment
Share on other sites

  • 8 months later...

Big thanks Jim for all the work with this addon!!  Installation went smoothly once I figured everything out but I know this thread is old but I have a question.  How would you add the products images next to the product name?  I have been toying around with it for time and can't seem to figure out how to have it call for the products_images.   Here is how I have it right now

 

 // Get the products info for the order
        $products_query = tep_db_query ("select products_name,
                                                products_model,
                                                products_id
                                         from " . TABLE_ORDERS_PRODUCTS . "
                                         where orders_id = '" . $orders_id . "'");
        $orders_picture = tep_db_fetch_array($orders_picture_query);  
        $orders_picture_query = tep_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int)$order->products[$i]['id'] . "'");
        $orderarray[$i] = array("Image" => "<img src=".HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $orders_picture['products_image']." width='90px' border='0'>");}

 

          // Get a list of products and links to the review page for each
          $products_string = '';
          while ($products_array = tep_db_fetch_array ($products_query) ) { // Step through the products
            // Add each product and each review URL to a list
            $products_string .= $products_array['products_image'] . ' ' . $products_array['products_name'] . "\n";
            $products_string .= '  ' . $link_server . DIR_WS_HTTPS_CATALOG . '/product_reviews_write.php?products_id=' . $products_array['products_id'] . "\n";

 

Thanks

Edited by shonus90
Link to comment
Share on other sites

You got things a bit out of order, but the basic idea is correct. Try this:

 

// Get the products info for the order
        $products_query = tep_db_query ("select products_name,
                                                products_model,
                                                products_id
                                         from " . TABLE_ORDERS_PRODUCTS . "
                                         where orders_id = '" . $orders_id . "'");
          // Get a list of products and links to the review page for each
          $products_string = '';
          while ($products_array = tep_db_fetch_array ($products_query) ) { // Step through the products
            $orders_picture_query = tep_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_array['products_id'] . "'");
            $orders_picture = tep_db_fetch_array($orders_picture_query); 
            $image_string = '<img src='".HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $orders_picture['products_image'].'" width="90px" border="0">';
 
            // Add each product and each review URL to a list
            $products_string .= $image_string . ' ' . $products_array['products_name'] . "\n";
            $products_string .= '  ' . $link_server . DIR_WS_HTTPS_CATALOG . '/product_reviews_write.php?products_id=' . $products_array['products_id'] . "\n";

 

Not tested, so beware typos. Also make sure you are sending HTML email or the recipient won't see your images.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Thanks again Jim!!

 

I edited $image_string to correct a syntax error and this is how it looks now.

 

         $orders_picture_query = tep_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_array['products_id'] . "'");
         $orders_picture = tep_db_fetch_array($orders_picture_query);  
         $image_string = '<img src='. DIR_WS_CATALOG . DIR_WS_IMAGES. $orders_picture['products_image'].' width="90px" border="0">';

 

So I have send Emails in HTML format enabled  and the image boxes are appearing but the links are broken because this is how it is writing the image source

www.jupiteroceansports.comdir_ws_catalogimages/hewlett_packard/lj1100xi.gif  

 

Any thoughts?

Edited by shonus90
Link to comment
Share on other sites

Figured it out just changed DIR_WS_CATALOG   to  DIR_WS_HTTP_CATALOG

 

I am not used to using files without any styling to start out with so how might I say group the image, product name, and review together and say give spacing to the name and align it with the top of the image?

 

Would I create divs with $products_string and everything else?

 

Thanks

Link to comment
Share on other sites

Beat me to it.

 

Use plain HTML to style your email. You can use embedded CSS as well. Try to keep it simple so your email doesn't take forever to load.

 

Regards

Jim

Edited by kymation

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

  • 4 months later...
  • 1 month later...
  • 10 months later...

This addon sends a separate email to every person on the list for that day. So no, that should not happen.

 

Regards

Jim

 

But not separated. The first who make an order that day get the email. But the rest of the people who make an order get the first mail as a CC. So when 10 people make an order the same day. The see the email addresses of each other.

Link to comment
Share on other sites

@@Simpel  This is still wrong. The code for this addon clearly sends a separate email to each customer,. There is no way that this code can combine emails.

 

There is an email sent to the store admin with the number of emails sent that day. That is only an aggregate count and not a copy of the email sent to customers. It also does not send CC copies to anyone.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

  • 1 month later...

"There is an email sent to the store admin with the number of emails sent that day."

------

The ... review reminder script finished execution on
28 Nov 2015 16:15:44

3 email messages were sent.

------

Every customer gets this email also and see each other.

 

it seems the script search the database for the right time range and then send all the customers in that range the same email. instead of separated, the script send to all of them., so they automatic see each other.

Link to comment
Share on other sites

There is no way for the code in this Addon to do this. Every email is sent separately using the osCommerce tep_mail() function. Each customer is sent a separate message, and the Admin message is sent only to the store owner.

 

The only possible explanation for this happening is that some external program is aggregating the emails. I have no way to determine whether that is happening.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

  • 1 year later...

Hello, the cronjob return those 2 errors

[06-Nov-2017 16:00:01 America/Chicago] PHP Warning: require(../includes/configure.php): failed to open stream: No such file or directory in /home/macrotro/public_html/automatic/review_mail.php on line 45

[06-Nov-2017 16:00:01 America/Chicago] PHP Fatal error: require(): Failed opening required '../includes/configure.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/macrotro/public_html/automatic/review_mail.php on line 45

The cronjob line : /usr/local/bin/php -q /home/user/public_html/automatic/review_mail.php

What could be the problem ? thanks

Link to comment
Share on other sites

It sounds like your store is not installed in the root of your site. You need to change the path on line 17 of review_mail.php to reflect the actual path to your store's root.

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

On 11/7/2017 at 6:53 PM, kymation said:

It sounds like your store is not installed in the root of your site. You need to change the path on line 17 of review_mail.php to reflect the actual path to your store's root.

Regards

Jim

but it is installed on the root directory, when I run http://macrotronics.net/automatic/review_mail.php

I get : #!/usr/local/bin/php

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...