Post by sterikal » Thu Feb 14, 2019 3:33 pm

Hi - I'm using the free Reward Points extension by E-Intelligence LINK and it works a treat but I would like something changed on it and have tried to contact E-Intelligence but I haven't received a reply so I was hoping that someone can help me out on here.

The extension adds a number of reward points for the first review but I would like to change it so that it adds reward points for all reviews not just the first one.

Is this something someone can do for me and if so can you let me know the cost?

All other aspects of the extension are great.

Cheers
Marc

New member

Posts

Joined
Sat Nov 12, 2016 5:33 pm

Post by pprmkr » Thu Feb 14, 2019 7:41 pm

Code: Select all

					$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "customer_reward WHERE customer_id = '" . (int)$this->customer->getId() . "' AND description = '" . $this->db->escape($this->language->get('text_review')) . "'");

					if($query->row['total'] < 1) {
						$this->db->query("INSERT INTO " . DB_PREFIX . "customer_reward SET customer_id = '" . (int)$this->customer->getId() . "', order_id = '0', description = '" . $this->db->escape($this->language->get('text_review')) . "', points = '" . (float)$this->config->get('reward_point_reviews') . "', date_added = NOW()");
					}

This part checks if customer had Reward points before. If No, add points.
If you want to add points for every review, remove the check for points.
Edit rewardPoint.ocmod.xml and replace code for catalog/model/catalog/review.php into:

Code: Select all

   <file path="catalog/model/catalog/review.php">
		<operation>
			<search>
				<![CDATA[$review_id = $this->db->getLastId();]]>
			</search>
			<add position="after">
				<![CDATA[
				
				if($this->customer->getId() && $this->config->get('reward_point_reviews_status')) {
					$this->load->language('product/product');      
					
					$this->db->query("INSERT INTO " . DB_PREFIX . "customer_reward SET customer_id = '" . (int)$this->customer->getId() . "', order_id = '0', description = '" . $this->db->escape($this->language->get('text_review')) . "', points = '" . (float)$this->config->get('reward_point_reviews') . "', date_added = NOW()");
				}
				
				]]>
			</add>
		</operation>
   </file>
Then delete modification, install new ocmod.xml and Refresh modifications.

User avatar
Active Member

Posts

Joined
Sat Jan 08, 2011 11:05 pm
Location - Netherlands

Post by sterikal » Fri Feb 15, 2019 1:10 am

Thanks for that.

New member

Posts

Joined
Sat Nov 12, 2016 5:33 pm
Who is online

Users browsing this forum: No registered users and 6 guests