Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

Recommended Posts

Есть модификатор который выводит фото по ссылке. У донора фото разных размеров и соотношения. Нужно добавить в мод чтоб потягивал настройки из темы, тема гдефолт. Просто ресайз из настроек темы. Еещё есть несколько задач, но все по порядку.

Link to comment
Share on other sites


Если верно понял, то ик

 

для версии 2.3

$image = $this->model_tool_image->resize($image, $this->config->get($this->config->get('config_theme') . '_image_popup_width'), $this->config->get($this->config->get('config_theme') . '_image_popup_height'));

 

для версии 3

$image = $this->model_tool_image->resize($image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height'));

 

Link to comment
Share on other sites

12 минут назад, S_A_P сказал:

Если верно понял, то ик

 

для версии 2.3

$image = $this->model_tool_image->resize($image, $this->config->get($this->config->get('config_theme') . '_image_popup_width'), $this->config->get($this->config->get('config_theme') . '_image_popup_height'));

 

для версии 3

$image = $this->model_tool_image->resize($image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height'));

 

 

Уже есть модификатор. Нужно чуток подправить. 

 

Спойлер
<modification>
    <name>iSellSoft RemoteImage</name>
    <code>iSellSoft-RemoteImage</code>
    <version>1.0.1</version>
    <author>iSellSoft Team</author>
    <file path="admin/model/tool/image.php">
	<operation error="skip"> 
	    <search><![CDATA[return;]]></search>
	    <add offset="0" position="replace"><![CDATA[return $filename;]]></add>
	</operation>
    </file>
    <file path="catalog/model/tool/image.php">
	<operation error="skip"> 
	    <search><![CDATA[return;]]></search>
	    <add offset="0" position="replace"><![CDATA[return $filename;]]></add>
	</operation>
    </file>
    <file path="admin/controller/catalog/product.php">
	<operation error="skip"> 
	    <search><![CDATA[is_file(DIR_IMAGE . $result['image'])]]></search>
	    <add offset="0" position="replace"><![CDATA[ ( 1 ) ]]></add>
	</operation>
	<operation error="skip"> 
	    <search><![CDATA[is_file(DIR_IMAGE . $product_info['image'])]]></search>
	    <add offset="0" position="replace"><![CDATA[ ( 1 ) ]]></add>
	</operation>
	<operation error="skip"> 
	    <search><![CDATA[is_file(DIR_IMAGE . $product_image['image'])]]></search>
	    <add offset="0" position="replace"><![CDATA[ ( 1 ) ]]></add>
	</operation>
    </file>
    <file path="admin/view/template/catalog/product_form.twig">
	<operation error="skip"> 
	    <search><![CDATA[
                <input type="hidden" name="image" value="{{ image }}" id="input-image" />
            ]]></search>
	    <add offset="0" position="replace"><![CDATA[ 
                <input type="text"  class="form-control" name="image" value="{{ image }}" id="input-image" />
             ]]></add>
	</operation>
	<operation error="skip"> 
	    <search><![CDATA[
                <input type="hidden" name="product_image[{{ image_row }}][image]" value="{{ product_image.image }}" id="input-image{{ image_row }}" />
            ]]></search>
	    <add offset="0" position="replace"><![CDATA[ 
                <input type="text"  class="form-control" name="product_image[{{ image_row }}][image]" value="{{ product_image.image }}" id="input-image{{ image_row }}" />
             ]]></add>
	</operation>
	<operation error="skip"> 
	    <search><![CDATA[<img src="{{ product_image.thumb }}"]]></search>
	    <add offset="0" position="replace"><![CDATA[<img src="{{ product_image.thumb }}" style="max-width:100px;height:auto" ]]></add>
	</operation>
	<operation error="skip"> 
	    <search><![CDATA[<img src="{{ thumb }}"]]></search>
	    <add offset="0" position="replace"><![CDATA[<img src="{{ thumb }}" style="max-width:100px;height:auto" ]]></add>
	</operation>
    </file>
  <file path="admin/view/template/catalog/product_list.twig">
	<operation error="skip"> 
	    <search><![CDATA[<td class="text-center">{% if product.image %} <img src="{{ product.image }}" alt="{{ product.name }}" class="img-thumbnail" /> {% else %} <span class="img-thumbnail list"><i class="fa fa-camera fa-2x"></i></span> {% endif %}</td>
            ]]></search>
	    <add position="replace"><![CDATA[
				<td class="text-center">
<div class="container" style="max-height: 100px;
    overflow: hidden;
    border-radius: 12px;
    max-width: 100px;
    padding: 0;
    border: 1px solid #f2eded">
{% if product.image %} 
						<img src="{{ product.image }}" alt="{{ product.name }}" class="img-thumbnail" style="max-width:100px;height:auto;padding: 0" /> {% else %} 
						<span class="img-thumbnail list"><i class="fa fa-camera fa-2x"></i></span> {% endif %}
</div>
				</td>
             ]]></add>
	</operation>
    </file>
</modification>

 

 

Мне это не по зубам. Я на уровне обезьяны, скопировать всивить.

Link to comment
Share on other sites


11 часов назад, LeotaDerron сказал:

Есть модификатор который выводит фото по ссылке. У донора фото разных размеров и соотношения. Нужно добавить в мод чтоб потягивал настройки из темы, тема гдефолт. Просто ресайз из настроек темы. Еещё есть несколько задач, но все по порядку.

Сгделайте это стилями уже на фронтенгде.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.