Post by mausz85 » Fri Dec 15, 2017 11:18 am

How can i change those button's contents?
Ex. i wanna change "PRE-ORDER" to "FILL THE FORM" or anything else (link: http://www.led-biz.com/index.php?route= ... duct_id=77 )
I tried to use a PHP File Search engine to look through my data but cannot find anything related to those info.
Any help?

New member

Posts

Joined
Wed May 24, 2017 3:04 pm

Post by IP_CAM » Fri Dec 15, 2017 11:41 am

Preorder ist not a OC Stock Module or Option, as I am aware of, but if
it would, such Pronouncions are located in the Language Section, in this Case,
usually in the yourlanguage/product/product.php file.
Otherwise, they are part of a VqMod / OcMod or an Extension, placing it's own
language file into the language Subdirectory somewhere.
If it is done by OcMod, it could only be found in the Database Modification Table, and
not in something like a vqmod/xml/... Directory, as it is the case with VqMod.
Ernie

Ernie's OpenCart v.1.5.6.5 LIGHT + OpenShop Admin v.1.75 Test Sites
http://www.bigmax.ch - https://github.com/IP-CAM - http://www.jti.li
Image


User avatar
Guru Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by mausz85 » Fri Dec 15, 2017 12:10 pm

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<modification>
    <name>Out of Stock Button</name>
    <version>2.1</version>
    <code>out_of_stock</code>
    <author>REDS</author>
    <link>//www.agenciaprai.com</link>
	
	<!-- checks the stock in the controller //-->
    <file path="catalog/controller/product/product.php">
        <operation>
            <search><![CDATA[if ($product_info['quantity'] <= 0) {]]></search>
            <add position="before"><![CDATA[
                $data['stock_quantity'] = $product_info['quantity'];
                $data['text_out_of_stock'] = $product_info['stock_status'];
            ]]></add>
        </operation>
    </file> 
	
	<!-- search in product page position for raplace //-->
    <file path="catalog/view/theme/*/template/product/product.tpl">
        <operation>
            <search><![CDATA[<button type="button" id="button-cart" data-loading-text="<?php echo $text_loading; ?>" class="btn btn-primary btn-lg btn-block"><?php echo $button_cart; ?></button>]]></search>
            <add position="replace"><![CDATA[<?php if ($stock_quantity < 1) { ?> 
                <button type="button" id="button-cart" disabled="disabled" data-loading-text="<?php echo $text_loading; ?>" class="btn btn-primary btn-lg btn-block"><?php echo $text_out_of_stock; ?></button>
              <?php } else { ?>
                <button type="button" id="button-cart" data-loading-text="<?php echo $text_loading; ?>" class="btn btn-primary btn-lg btn-block"><?php echo $button_cart; ?></button>
              <?php }?>]]></add>
        </operation>

        <operation>
            <search><![CDATA[<input type="text" name="quantity" value="<?php echo $minimum; ?>" size="2" id="input-quantity" class="form-control" />]]></search>
            <add position="replace"><![CDATA[<?php if ($stock_quantity > 1) { ?> 
    <input type="text" name="quantity" value="<?php echo $minimum; ?>" size="2" id="input-quantity" class="form-control" />
<?php }?>]]></add>
        </operation>

        <operation>
            <search><![CDATA[<label class="control-label" for="input-quantity"><?php echo $entry_qty; ?></label>]]></search>
            <add position="replace"><![CDATA[<?php if ($stock_quantity > 1) { ?> 
    <label class="control-label" for="input-quantity"><?php echo $entry_qty; ?></label>
<?php }?>]]></add>
        </operation>
    </file>  
	
	<!-- search in category position for replace //-->
    <file path="catalog/controller/product/category.php">
        <operation>
            <search><![CDATA[$data['products'][] = array(]]></search>
            <add position="after"><![CDATA['quantity'     => $result['quantity'],
                'text_out_of_stock'     => $result['stock_status'],
                ]]></add>
        </operation>
    </file> 

    <file path="catalog/view/theme/*/template/product/category.tpl">
        <operation>
            <search><![CDATA[<button type="button" onclick="cart.add('<?php echo $product['product_id']; ?>', '<?php echo $product['minimum']; ?>');"><i class="fa fa-shopping-cart"></i> <span class="hidden-xs hidden-sm hidden-md"><?php echo $button_cart; ?></span></button>]]></search>
            <add position="replace"><![CDATA[<?php if ($product['quantity'] < 1) { ?>
                  <button type="button" disabled="disabled" onclick="cart.add('<?php echo $product['product_id']; ?>', '<?php echo $product['minimum']; ?>');"><i class="fa fa-warning"></i> <span class="hidden-xs hidden-sm hidden-md"><?php echo $product['text_out_of_stock']; ?></span></button>
                <?php } else { ?> 
                  <button type="button" onclick="cart.add('<?php echo $product['product_id']; ?>', '<?php echo $product['minimum']; ?>');"><i class="fa fa-shopping-cart"></i> <span class="hidden-xs hidden-sm hidden-md"><?php echo $button_cart; ?></span></button>
                <?php } ?>]]></add>
        </operation>
    </file> 

    <!-- note: You can duplicate this part for other modules to be used in the store //-->
	<!-- search in module featured for replace //-->
	<file path="catalog/controller/module/featured.php">
        <operation>
            <search><![CDATA[$data['products'][] = array(]]></search>
            <add position="after"><![CDATA['quantity'     => $product_info['quantity'],
                'text_out_of_stock'     => $product_info['stock_status'],
                ]]></add>
        </operation>
    </file>

    <file path="catalog/view/theme/*/template/module/featured.tpl">
        <operation>
            <search><![CDATA[<button type="button" onclick="cart.add('<?php echo $product['product_id']; ?>');"><i class="fa fa-shopping-cart"></i> <span class="hidden-xs hidden-sm hidden-md"><?php echo $button_cart; ?></span></button>]]></search>
            <add position="replace"><![CDATA[<?php if ($product['quantity'] < 1) { ?>
                  <button type="button" disabled="disabled" onclick="cart.add('<?php echo $product['product_id']; ?>');"><i class="fa fa-warning"></i> <span class="hidden-xs hidden-sm hidden-md"><?php echo $product['text_out_of_stock']; ?></span></button>
                <?php } else { ?> 
                  <button type="button" onclick="cart.add('<?php echo $product['product_id']; ?>');"><i class="fa fa-shopping-cart"></i> <span class="hidden-xs hidden-sm hidden-md"><?php echo $button_cart; ?></span></button>
                <?php } ?>]]></add>
        </operation>
    </file>
	<!-- note: You can duplicate this part for other modules to be used in the store //-->

    <!-- search ins search store  replace buttom //-->
	<file path="catalog/controller/product/search.php">
        <operation>
            <search><![CDATA[$data['products'][] = array(]]></search>
            <add position="after"><![CDATA['quantity'     => $result['quantity'],
                'text_out_of_stock'     => $result['stock_status'],
                ]]></add>
        </operation>
    </file>

    <file path="catalog/view/theme/*/template/product/search.tpl">
        <operation>
            <search><![CDATA[<button type="button" onclick="cart.add('<?php echo $product['product_id']; ?>', '<?php echo $product['minimum']; ?>');"><i class="fa fa-shopping-cart"></i> <span class="hidden-xs hidden-sm hidden-md"><?php echo $button_cart; ?></span></button>]]></search>
            <add position="replace"><![CDATA[<?php if ($product['quantity'] < 1) { ?>
                  <button type="button" disabled="disabled" onclick="cart.add('<?php echo $product['product_id']; ?>', '<?php echo $product['minimum']; ?>');"><i class="fa fa-warning"></i> <span class="hidden-xs hidden-sm hidden-md"><?php echo $product['text_out_of_stock']; ?></span></button>
                <?php } else { ?> 
                  <button type="button" onclick="cart.add('<?php echo $product['product_id']; ?>', '<?php echo $product['minimum']; ?>');"><i class="fa fa-shopping-cart"></i> <span class="hidden-xs hidden-sm hidden-md"><?php echo $button_cart; ?></span></button>
                <?php } ?>]]></add>
        </operation>
    </file> 
</modification>
This is the extensione code...any idea if i can change from here? (out of stock would work too, no need preorder)
I tried to contact the extension creator but didnt get any reply~

New member

Posts

Joined
Wed May 24, 2017 3:04 pm

Post by IP_CAM » Mon Dec 18, 2017 1:29 pm

Well, in this Extension, the VARIABLE in charge is:

Code: Select all

$product['text_out_of_stock']; ?>
But the VqMod shown does not contain any Language-File-related
Content. And in the corresponding Language File, this Variable
contains the 'Content' Pre-Order, that's all.

You just have to change this Variable-'Content', whereever it exist,
either in some language File, or then, in some Extension, I have no idea,
and did not find it in the Default v.2.x Versions I checked on this.
Good Luck!
Ernie

Ernie's OpenCart v.1.5.6.5 LIGHT + OpenShop Admin v.1.75 Test Sites
http://www.bigmax.ch - https://github.com/IP-CAM - http://www.jti.li
Image


User avatar
Guru Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: No registered users and 12 guests