texts:
I'd like to create my custom field type to use it in system config forms (System -> Configuration). For example, to create simple text field we need to use <frontend_type>text</frontend_type> in system.xml which tells Magento to use file lib/Varien/Data/Form/Element/Text.php:

<config>

    <sections>
        <mycustom_section translate="label">
            My Module
            <sort_order>0</sort_order>
            <show_in_default>1</show_in_default>
            <show_in_website>1</show_in_website>
            <show_in_store>1</show_in_store>
            <groups>
                <mycustom_group translate="label">
                    My Custom Group
                    <sort_order>0</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>1</show_in_store>
                    <fields>
                        <heading_sample translate="label">
                            Sample heading
                            <sort_order>0</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                            <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
                        </heading_sample>
                        <mycustom_field translate="label comment">
                            My Custom Field
                            <sort_order>1</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                            <frontend_type>text</frontend_type>
                            <frontend_model>mymodule/custom</frontend_model>
                        </mycustom_field>

                    </fields>
                </mycustom_group>
            </groups>
        </mycustom_section>
    </sections>
</config>

If I create my own class (that extends Magento's Varien_Data_Form_Element_Abstract class) that renders my custom field, where I should put this file?

It will probably work (will it?) if I put it inside Magento default directory
lib/Varien/Data/Form/Element/Customized.php:

<mycustom_group>

    <fields>
        <mycustom_field translate="label comment">
            My Custom Field
            <comment>Some comment about my field</comment>
            <show_in_default>1</show_in_default>
            <show_in_website>1</show_in_website>
            <show_in_store>1</show_in_store>
            <frontend_type>customized</frontend_type>
        </mycustom_field>
    </fields>
</mycustom_group>

But is there any way to keep my custom field file inside my custom module instead in lib/Varien/Data/Form/Element/? Adding custom files to the core directories isn't probably very good idea.
If not, can I create custom folder inside lib/, for example: lib/Mycompany/Customized.php? But in that case, how I can inform Magento in the <frontend_type> tag inside system.xml that it should use my custom field file and tell Magento where that file is located?


texts: Use of system > configuration > design and System > Design

texts:
Hi can any one explain

Differences and similarities between System > Configuration > Design and System > Design to configure the design fallback


texts: How to create an product view tab with the images gallery in Magento 2.1?

texts: I'd like to add a new tab on the product view page to show the gallery of images inside this tab.


texts: How to set Shipping Method and Payment Method for Diffrent Country

texts:
I can change shipping method and default country from back-end settings as:

  Store -> Configuration -> General -> General.

How to set up default shipping method and payment method for two different countries?

Much appreciated your help.


texts: Magento 2 : override abstarct class method

texts:
I want to override mone method prepare of class

  Magento\Ui\Component\Form\Element\AbstractOptionsField

I tried to do with preference but there is no effect

I also tried using plugin but it throws error

below is my plugin code

<type name="Magento\Ui\Component\Form\Element\AbstractOptionsField">
        <plugin name="aroundPrepare_override" type="Vendor\Custom\Plugin\AbstractOptionsField"/>
    </type>

  AbstractOptionsField file

<?php
namespace Vendor\Custom\Plugin;

use Magento\Framework\Data\OptionSourceInterface;
use Magento\Framework\View\Element\UiComponent\ContextInterface;

class AbstractOptionsField extends \Magento\Ui\Component\Form\Element\AbstractElement
{

    public function __construct(
        ContextInterface $context,
        $options = null,
        array $components = [],
        array $data = []
    ) {
        $this->options = $options;
        parent::__construct($context, $components, $data);
    }

    public function aroundPrepare(
        \Magento\Ui\Component\Form\Element\AbstractOptionsField $subject,
        \Closure $proceed
    ) {

        $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/customer123.log');
        $logger = new \Zend\Log\Logger();
        $logger->addWriter($writer);
        $logger->info("test");
   }

}

Can anyone help me what I missing.

  error

Class Vendor\Custom\Plugin\AbstractOptionsField contains 1 abstract method and must therefore be declared abstract or implement the remaining methods


texts:
added:

"autoload": {
"psr-4": {
  "Magento\\Framework\\": "lib/internal/Magento/Framework/",
  "Magento\\Setup\\": "setup/src/Magento/Setup/",
  "Magento\\": "app/code/Magento/",
  "Zend\\Mvc\\Controller\\": "setup/src/Zend/Mvc/Controller/"
},

composer require magento/product-community-edition=2.3.0 --no-update

composer update

When running this I get below error. Php version 7.1.26

Problem 1
- magento/module-store 100.1.12 requires php ~5.6.5|7.0.2|7.0.4|~7.0.6 -> your PHP version (7.1.26) does not satisfy that requirement.
- magento/module-store 100.1.11 requires php ~5.6.5|7.0.2|7.0.4|~7.0.6 -> your PHP version (7.1.26) does not satisfy that requirement.
- magento/module-store 100.1.10 requires php ~5.6.5|7.0.2|7.0.4|~7.0.6 -> your PHP version (7.1.26) does not satisfy that requirement.
- magento/module-store 100.1.9 requires php ~5.6.5|7.0.2|7.0.4|~7.0.6 -> your PHP version (7.1.26) does not satisfy that requirement.

How can I solve this?


texts: Magento 2 : How to remove signout from my account section at header?

texts:
While customer logged into account it is showing two sign-out from header
Kindly check the below default.xml file from my custom theme.

Can you please suggest ? Actually I have used parent theme as Luma.

<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
    <referenceContainer name="header.links">
        <block class="Magento\Framework\View\Element\Html\Link\Current" name="helpcenter" before="track-link">
        <arguments>
        <argument name="label" xsi:type="string">Help Center</argument>
        <argument name="path" xsi:type="string">contact</argument>
        </arguments>
        </block>
    </referenceContainer>
        <referenceBlock name="logo">
            <arguments>
                <argument name="logo_img_width" xsi:type="number">148</argument>
                <argument name="logo_img_height" xsi:type="number">43</argument>
            </arguments>
        </referenceBlock>
        <referenceContainer name="footer-container">
            <block class="Magento\Theme\Block\Html\Footer" name="footer" template="html/footer.phtml"/>
        </referenceContainer>
        <referenceBlock name="report.bugs" remove="true"/>
        <move element="copyright" destination="before.body.end"/>
    </body>
</page>


texts:
I have set the client side compilation mode on within admin and have recieved lots of missing files errors. Error:

FileError: 'http://magento2.com/static/version1493890573/_cache/merged/source/_theme.less' wasn't found (404)

I have tried clearing static files and redploying them however the less files are not generated and only merged css files seem to be present on there.

I am wondering what to do here and if there is a way to disable client side compilation from shell or in database but would also like to fix the static deployment so the files are deployed correctly.


texts: How to Create a Module to replace the Specifications Table?

texts:
I am currently learning Magento development. I have 3 Magento websites that I have built and operate using a purchased theme. Now I would like to learn more about how to do customizations properly instead of "hacking" template files.

I followed instructions online on how to create a simple module on Magento 2. The basic module is working and just outputs Hello World. Now, I would like to extend the functionality.

http://inchoo.net/magento-2/how-to-create-a-basic-module-in-magento-2/

What I would like to do is to replace the specifications table that shows on product pages. I would like to use a different template for each attribute set.

Any tips on pointing me in the right direction to build this myself? I figured building my own module would be a good way to get a deeper understanding of how everything works.

Template to override
/html/vendor/magento/module-catalog/view/frontend/templates/product/view/attributes.phtml

Block
Magento\Catalog\Block\Product\View\Attributes

Thank you for your time.


texts: Wrong number of result in toolbar after overriding ListProduct

texts:
I've overrided the ListProduct.php file for the catalog, to show product based on customer attribute.

But now I have the wrong number of element in the toolbar (I have 3 products displayed but still the "unfiltered" number in the toolbar).

I've added condition in initializeProductCollection function


texts: Create alternate /catalog/product/price.phtml template for 1 page

texts:
On my home page I have a custom block that called a list of 4 "featured" products. This displays 4 products on my homepage. I want to style the price section quite a bit different then it displays on the actual product page.

How can I call a separate price template file for use just in that one block on my home page?

Here is the code I use to show the featured product.

<?php
/**
 * Small Featured Homepage Products
 *
 * @see Mage_Catalog_Block_Product_List
 */
?>
<?php
    $_productCollection=$this->getLoadedProductCollection();
    $_helper = $this->helper('catalog/output');
?>
<?php if(!$_productCollection->count()): ?>

<?php echo $this->__('There are no products matching the selection.') ?>

<?php else: ?>

    <?php // Grid Mode ?>

    <?php $_collectionSize = $_productCollection->count() ?>
    <?php $_columnCount = $this->getColumnCount(); ?>
    <?php $i=0; foreach ($_productCollection as $_product): ?>
        <?php if ($i <= 2): ?>
        <?php if ($i++%$_columnCount==0): ?>

        <?php endif ?>
            <li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
                <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->constrainOnly(true)->keepAspectRatio(true)->keepFrame(false)->resize(135, null); ?>" width="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />

<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?>

                <?php if($_product->getRatingSummary()): ?>
                <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
                <?php endif; ?>

                <?php echo $this->getPriceHtml($_product, true) ?>

                    <?php if($_product->isSaleable()): ?>
                        <button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><?php echo $this->__('Add to Cart') ?></button>
                    <?php else: ?>

<?php echo $this->__('Out of stock') ?>

                    <?php endif; ?>

        <?php if ($i%$_columnCount==0 || $i==$_collectionSize): ?>

        <?php endif ?>
        <?php endif ?>
        <?php endforeach ?>

    <?php endif; ?>


texts: How can I add a Handling time to my shipping methods on Magento?

texts: I need to add a handling time for personalized items so people do not order something expecting it by a certain date, how can I add this feature to my shipping methods?


texts: Customizable option price not updated to cart

texts:
I have aaded some custom option like

When i checked the checkbox on product details page it shows price less than 200 but when i hit add to cart it added the normal price of product not the price with -200.
Any one have any idea regarding this any help is appriciated.


texts: Check if current layout has another block by name PHP - Magento 2

texts:
I want to add classes to two elements on the page specifically if two or one other element is on the page, so in the phtml I will have to check if those elements are included in the layout.

How can this be done?


texts: Under 99 category with automatic product assign with Layered naviagtion

texts:
I have a category like "under 99" in which I need all the product with price 99 and below.

I want to use default list.phtml for products listing so design will be same as default.

I also want default layered navigation working as category page.

I have create custom block class and also used custom layout handle in category but no luck.

Any help is much appreciated.


texts: Magento2 include controller to existing signup customer button and also fetch the store config values in observer

texts:
Can anyone help me how to include a controller to existing customer create signup button, So that i will add some functionality to this controller.

in magento2

I have a Helper data like below:

namespace Vendor\Module\Helper;

use Magento\Framework\App\Helper\AbstractHelper;
use Magento\Store\Model\ScopeInterface;

class Data extends AbstractHelper
{
   public function getGeneralConfig($code, $storeId = null)
   {

   return $this->getConfigValue(self::XML_PATH_HELLOWORLD .'general/'. $code, $storeId);
   }
    FIRST_SIGNUP_POINTS = 'test/social_integration/f_signup';
   public function Test() {
     $points = $this->scopeConfig->getValue(selF::FIRST_SIGNUP_POINTS); if($points){
     $points = (int)$points;
   }
   return $points;
   }
}

This is my model file name: loyalitytransaction

Thanks


texts: de-select a selected radio button on click

texts:
HTML code:
.....

<input onclick="removeAttr(i)" name="autoselected[]" value="i" class="radio" checked="checked" type="radio">

....

function removeAttr(i) {

preSelected = $$('[input[type=radio][name=autoselected[]][value=' + i + ']');

 preSelected.each(function (item) {
        // De-Select a selected option in Prototype.
 });

}

any idea how to achieve this?


texts:
Magento Admin url keep on redirecting and shows the below error.
This webpage has a redirect loop

Frontend is working fine, but the problem is with the magento admin url.

Also this problem occurs after implementing patch.


texts: How to add backorder message to transactional emails

texts:
I want to add extra information in a transactional email when the order has a product which is backordered.

I know where and how to edit the email templates following this guide: http://www.flyingtophat.co.uk/blog/2011/08/31/magento-displaying-custom-attributes-in-emails.html

The problem is I don't know how to check if the order has backorder items. I found that the table sales_flat_order_item has a a field qty_backordered but it has no value and is NULL.

I can get the value of the field with the following code

echo $_item->getQtyBackordered();

My question is, why is the value of the field NULL? How can I make sure the field gets populated with the amount of items which are backordered? Or maybe there is another solution?

The only thing I actually need is to check if a placed order has at least 1 item backordered (so I can display extra backorder information).


texts:
Very often it is needed to add some custom logic to templates. For example it can be checking if customer is logged or some information about product - if it's already bought by current customer or if it's already in cart. The thing is how to do it in best way. There are many many ways to do it. Of course I am not wondering if it should be done in custom module or in theme, because it depends if it's more universal issue or just something needed only in theme.

First of all you can do it just writing some php code in your templates, but of course it not elegant and makes a real mess in your code.

Second way is to make preference on block, which is connected with templates we want to 'extend', but here comes drawbacks of overriding core files and in case that our functionality is needed in many places it's not efficient to override multiple blocks. Can't be used just for one theme, so it can break another ones if made in module for only one theme needs.

Third possible manner is to make a plugin on desired method and it works fine as long as it is not completely custom logic that needs some separate classes. So it can be achieved like this in many cases. Can't be used just for one theme, so it can break another ones if made in module for only one theme needs.

Fourth idea is to create new block, not necessarily with custom template. It can be just container for bunch of php methods. It can be easily added in any template using layout xmls and getChildBlock() method inside phtml. Although I am not sure if it is efficient to do it like this.

Last way I have figured out is to create custom helper classes, which can be easily called in any template just by using $this->helper('path\to\class') It is more portable way to add some logic, although helper needs to extend from it's abstract parent, so I am not sure here if it efficient. Also helper classes are discouraged from using, as not suiting anythin well, so code seems to be not well planned.

Has anyone well-checked way to achieve that? I would be extremely useful to hear points for any of these way, as well as discovering new ways to achieve that.


texts: How to remove Zip/postal code from customer registration form in Magento 2?

texts: I want to know how to remove Zip/postal code from customer registration form in Magento 2?


texts:
I am stuck for two days because my reindexing does not work by, I tried several things that I found on the net but nothing helps it does not work.
this is what I tried to do:
php bin / magento indexer: reset

then
php bin / magento indexer: reindex

which gave me as result this:
Design Config Grid index has been rebuilt successfully in 00:00:03
Customer Grid index has been rebuilt successfully in 00:00:01
Category Products index has been rebuilt successfully in 00:00:01
Product Categories index has been rebuilt successfully in 00:00:00
Catalog rule indexing failed. See details in exception log.
Table "natu_catalog_product_index_eav_decimal_replica" does not exist
Stock index has been rebuilt successfully in 00:00:06
Inventory index has been rebuilt successfully in 00:00:00
Catalog rule indexing failed. See details in exception log.
Product Price index has been rebuilt successfully in 00:00:02
Google Product Removal Feed index has been rebuilt successfully in 00:00:00
Google Product Feed index has been rebuilt successfully in 00:00:00
Catalog Search index has been rebuilt successfully in 00:00:01

But when I do php bin / magento indexer: status:
I still have 3 indexes which are still reindex required
+ ----------------------------- + ------------------ + ----------- + ----------------- + ------------------ +
| Title | Status | Update On | Schedule Status | Schedule Updated |
+ ----------------------------- + ------------------ + ----------- + ----------------- + ------------------ +
| Catalog Product Rule | Reindex required | Save | | |
| Catalog Rule Product | Reindex required | Save | | |
| Catalog Search | Ready | Save | | |
| Category Products | Ready | Save | | |
| Customer Grid | Ready | Save | | |
| Design Config Grid | Ready | Save | | |
| Google Product Feed | Ready | Save | | |
| Google Product Removal Feed | Ready | Save | | |
| Inventory | Ready | Save | | |
| Product Categories | Ready | Save | | |
| Product EAV | Reindex required | Save | | |
| Product Price | Ready | Save | | |
| Stock | Ready | Save | | |
+ ----------------------------- + ------------------ + ----------- + ----------------- + ------------------ +

What to do ?
Thank you in advance for your answers.


texts: Undefined variable: freePackageValue in Tablerate.php on line 130

texts:
In our development setup I get the following error if, after a long while, I refresh (or directly go to) the /checkout/cart/ or /checkout/onepage/ url, e.g. when the items in my cart have been removed due to a timeout or there is nothing in the cart at all.

Notice: Undefined variable: freePackageValue  in /var/www/dev/htdocs/app/code/core/Mage/Shipping/Model/Carrier/Tablerate.php on line 130

#0 /var/www/dev/htdocs/app/code/core/Mage/Shipping/Model/Carrier/Tablerate.php(130): mageCoreErrorHandler(8, 'Undefined varia...', '/var/www/dev/ht...', 130, Array)
#1 /var/www/dev/htdocs/app/code/core/Mage/Shipping/Model/Shipping.php(209): Mage_Shipping_Model_Carrier_Tablerate->collectRates(Object(Mage_Shipping_Model_Rate_Request))
#2 /var/www/dev/htdocs/app/code/core/Mage/Shipping/Model/Shipping.php(129): Mage_Shipping_Model_Shipping->collectCarrierRates('tablerate', Object(Mage_Shipping_Model_Rate_Request))
#3 /var/www/dev/htdocs/app/code/core/Mage/Sales/Model/Quote/Address.php(944): Mage_Shipping_Model_Shipping->collectRates(Object(Mage_Shipping_Model_Rate_Request))
#4 /var/www/dev/htdocs/app/code/core/Mage/Sales/Model/Quote/Address.php(875): Mage_Sales_Model_Quote_Address->requestShippingRates()
#5 /var/www/dev/.modman/integer-net_autoshipping/app/code/community/IntegerNet/Autoshipping/Model/Observer.php(46): Mage_Sales_Model_Quote_Address->collectShippingRates()
#6 /var/www/dev/htdocs/app/code/core/Mage/Core/Model/App.php(1338): IntegerNet_Autoshipping_Model_Observer->addShipping(Object(Varien_Event_Observer))
#7 /var/www/dev/htdocs/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(IntegerNet_Autoshipping_Model_Observer), 'addShipping', Object(Varien_Event_Observer))
#8 /var/www/dev/htdocs/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('controller_acti...', Array)
#9 /var/www/dev/htdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(531): Mage::dispatchEvent('controller_acti...', Array)
#10 /var/www/dev/htdocs/app/code/core/Mage/Core/Controller/Front/Action.php(64): Mage_Core_Controller_Varien_Action->preDispatch()
#11 /var/www/dev/htdocs/app/code/core/Mage/Checkout/controllers/CartController.php(126): Mage_Core_Controller_Front_Action->preDispatch()
#12 /var/www/dev/htdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(407): Mage_Checkout_CartController->preDispatch()
#13 /var/www/dev/htdocs/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#14 /var/www/dev/htdocs/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#15 /var/www/dev/htdocs/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#16 /var/www/dev/htdocs/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#17 /var/www/dev/htdocs/index.php(87): Mage::run('my_storeview', 'store')
#18 {main}

Now in our live setup this is no issue at all, as the "your cart is empty" message is correctly shown, but I do wonder why in our dev setup (where all the magento and php error output is set to on) this is happening.

Anybody got a clue?


texts: Move image upload field to a different tab

texts:
How can I move the image upload field to the General tab (when adding a new product in the admin panel)?

I tried moving the image attribute into the General tab, but it didn't do anything. I also found this but I'm unsure how to apply it for the images tab.


texts: I am getting warning message of this "This site ahead contains malware" in google chrome

texts:
After I installed local setup for magento 2.1.16 with nginx server. When I try to visit my site in chrome it notify with site ahead contain malware.
I have tried removing all third party extensions.
I have seen some answers, they were saying to scan for malware from online free sites. How could i do that for my local setup.
Could anybody help?


texts: Simplify Magento Module API Error [Merchant processing is unavailable pending completion of registration]

texts:
I just installed the free extension from https://github.com/simplifycom/simplify-magento-module suggested by the Simplify Commerce at https://www.simplify.com/ to enable Credit Card payments. I installed the Live/Sandbox API keys but every time I am trying to complete a credit card payment, I receive the error "Merchant processing is unavailable pending completion of registration.". The appropriate section inside the Simplify Commerce does not give enough explanation for this error.
https://www.simplify.com/commerce/docs/misc/errors
merchant.pending.configurationMerchant processing is unavailable pending completion of registration.

Can someone give me some information about this error?
Best Regards,


texts:
I am using a gift card extension(AheadWorks) in magento community ver. 1.9.0.1
i am trying to display the gift card block on payment methods section as other methods are displaying.

there can be two way what i think:
1) Calling that block on payment methods section after payment methods
2) I need to override the Payment Block in gift card extension.

Please suggest with some code hint.


texts: Custom product option price ignored by backend when making new order

texts:
When making a new order in the magento admin backend the website price for a custom option is ignored and uses the default.

The frontend works fine the issue is only from admin.

the issue only happens when you get the shipping price,

The website "price" is used but any custom option that has an additional charge (eg +£20) will use the default price what ever it might be.


texts: How to get the protected property from core module to custom module in magento 2

texts:
I have created the block file which extends \Magento\Config\Block\System\Config\Form\Field\FieldArray\AbstractFieldArray from Module-Config. Now I need to get Protected property from the above core file. Please provide me a solution

\Magento\Config\Block\System\Config\Form\Field\FieldArray\AbstractFieldArray

 public function addColumn($name, $params)
        {
            $this->_columns[$name] = [
                'label' => $this->_getParam($params, 'label', 'Column'),
                'size' => $this->_getParam($params, 'size', false),
                'style' => $this->_getParam($params, 'style'),
                'class' => $this->_getParam($params, 'class'),
                'renderer' => false,
            ];
            if (!empty($params['renderer']) && $params['renderer'] instanceof \Magento\Framework\View\Element\AbstractBlock) {
                $this->_columns[$name]['renderer'] = $params['renderer'];
            }
        }

I need to get "_columns" to my custom template
System.xml

<field id="fieldslide" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
                    <label>Small image</label>
                    <frontend_model>X\Y\Block\Adminhtml\System\Config</frontend_model>
                    <backend_model>Magento\Config\Model\Config\Backend\Serialized\ArraySerialized</backend_model>
                    <comment>Image size should be in Bytes(1 KB = 1024 Bytes, 10 KB = 10240 Bytes, 50 KB = 51200 Bytes, 100 KB = 102400 Bytes, 150 KB = 153600 Bytes)</comment>
                </field>


texts: Magento cache issue (whole website gets messed up)

texts:
I have problem with my magento website using magento 1.9.2.4. I have had the cache disabled earlier.

If cache are all switched on, the BuyNow buttons in homepage will not work and cannot add products to shopping cart.

Product details and social sharing info block will disappear on product page.
The problem can be solved by disabling "blocks HTML output" cache.

Then I found that this was  due to Magento Blocks HTML Output cache problem but when  I disable this cache, my site works well.

I followed this link  but not got expected result.

One more problem with cache is when my cache are disable  Interface Locale at admin will not chnage hence some attribute gives error while importing csv.
Thanks in advance


texts: Capistrano deployments to an nginx webserver results in bad asset URLs

texts:
I am using Capistrano to deploy Magento code to a webserver that is running nginx. Nginx web root for test.url.com is /var/www/html, which on the filesystem is a symlink to /opt/magento-codebase/current (which in itself is a symlink to /opt/magento-codebase/releases/TIMESTAMP). See http://capistranorb.com/documentation/getting-started/structure for more details on how Cap. sets up its directories.

Everything loads right, except for assets described in Magento's layout XML files. When generating the URLs via the Mage_Page_Block_Html_Head::addItem() method it ends up including the full path to the file in the URL. For example, <action method="addItem"><type>skin_css</type><name>css/tools.css</name></action> results in:

http://test.url.com/opt/magento-codebase/releases/TIMESTAMP/skin/frontend/store1/default/css/tools.css

should be

http://test.url.com/skin/frontend/store1/default/css/tools.css

Is there an nginx or Magento configuration I can use to tell it not to include the resolved directory? I'm testing this locally and we are not combining JS assets or CSS assets into the hashed file stored in /media yet.

Update: I checked and when dev/js/merge_files is set to 1 and dev/css/merge_css_files is set to 1 in core_config_data, it doesn't work. WhenI set them to 0, it loads correctly...


texts:
I have run php bin/magento in command prompt then following error occurred:

PHP Parse error:  syntax error, unexpected '?' in
MyProjectPath\vendor\magento\magento-cloud-configuration\src\Magento\MagentoCloud\Console\Command\Deploy.php on line 538

Parse error: syntax error, unexpected '?' in D:\MyProjectPath\vendor\magento\magento-cloud-configuration\src\Magento\MagentoCloud\Console\Command\Deploy.php on line 538

I'm using php 7.02 (XAMPP version) according to the documentation.

I found ??-syntax in Deploy.php which is supported by PHP7 in general.

Why does this error occur?

Thanks


texts: Fatal error: require_once(): Failed opening required 'D:\xampp\htdocs\magento\errors\report.php'

texts:
i just copied working folders and files from Ubuntu to windows and whenever i try run the project am getting error like:

  Fatal error: require_once(): Failed opening required 'D:\xampp\htdocs\geedel\errors\report.php' (include_path='D:\xampp\htdocs\geedel\app\code\local;D:\xampp\htdocs\geedel\app\code\community;D:\xampp\htdocs\geedel\app\code\core;D:\xampp\htdocs\geedel\lib;D:\xampp\php\PEAR') in D:\xampp\htdocs\geedel\app\Mage.php on line 925.

Any help would be greatly appreciated


texts:
I am trying to display a 'Sale' badge on product category pages if the products have a special price. Though the isn't rendering anything.

<?php if (_$product->getPriceInfo()->getPrice('special_price')->getValue()): ?>

Sale

                      <?php elseif ($_product->getResource()->getAttribute('badge')->getFrontend()->getValue($_product)): ?>

                              <div class="tag <?= /* @escapeNotVerified */ str_replace(' ', '_',strtolower($_product->getResource()->getAttribute('badge')->getFrontend()->getValue($_product))) ?>"><?= /* @escapeNotVerified */ $_product->getResource()->getAttribute('badge')->getFrontend()->getValue($_product) ?>

                      <?php endif; ?>


texts: How to hide product price from Google search

texts:
In my site we set product price & Add to cart button hide.
If customer login then they show price and Add to cart button.
It's properly working in our site.
But when we search product in google; then we show price.
Any one help me for hide product price from Google search.


texts: Magento 2 Unable to assign Product to category via API

texts:
There has been similar issues posted without an answer unfortunately but I am posting two ways in the API to set a category on a product both of which give different errors.

The first is using the categories repository (catalogCategoryLinkRepositoryV1)

example
In body POST

{
    "productLink" :
    {
        "sku" : "TEST_SKU5",
        "position" : 0,
        "categoryId" : "8",
        "extensionAttributes": {}

    }
}

Example Response :  This is the same response regardless of what category or product.

{
  "message": "Could not save product \"%1\" with position %2 to category %3",
  "parameters": [
    "144",
    0,
    "8"
  ]
}

The second is setting it under custom_attribute using the product repository in either new or update calls.  Both give the same result.

When setting the custom_attribute like below regardless of what sku and category I get an error.  If I leave out "category_ids" it works fine but defeats the purpose of using the API to manage product import and updates.

'custom_attributes' => array(
            array( 'attribute_code' => 'category_ids', 'value' => ["8"] ),
            array( 'attribute_code' => 'description', 'value' => 'Simple Description' ),
            array( 'attribute_code' => 'short_description', 'value' => 'Simple  Short Description' ),
            )

Error being the following, which is the only error I get regardless of what combination of sku and category even if the sku is not made yet and I am creating a new product..

"{\"message\":\"URL key for specified store already exists.\"}"


texts: I changed my base URL from http to https and now my site is inaccessible

texts:
I was trying to set up my magento store to use the ssl certificate I just bought and was told to change the base url to https instead of http.

Now the site and magento admin is inaccessible and I get the following 404 page:

Was it a bad idea to change the base url to https and is there any way I can fix this? Thank you


texts:
After upgrading to 2.1.0 my checkout page looks like this

In console there is an error

 TypeError: window.checkout is undefined

I tryed what was suggested here Magento 2 (CE) not displaying the Checkout page but it did not help


texts: Magento 2 - How to change Product Name dynamically in configurable product view page

texts:
How I can change my configurable product name and description dynamically when one option is selected, right now is change only the image, I need to do the same with the name and description.

HTML structure:

text description.


texts: I want create a bundle product,but when I click the save button,nothing happend,not saving,no error message,nothing in the console。can anyone help? thanks!


texts: Magento 2: Translation is not working in html template using data-bind

texts:
I have inserted the string to translate into the app/i18n/lg_lG.csv file.
I run the command to deploy static files, clean cache, but the string is not translated.
The string is located in this file:

vendor/magento/module-checkout/view/frontend/web/template/cart/shipping-estimation.html:12:

The magento verion is 2.3.1 .


texts:
Everything was working fine on one page checkout, But now it seems to give me a error of Please Choose to register or to checkout as guest even if I select any of these option and try to click on Continue button.

In My Console I have these errors

http://domain.com/skin/frontend/base/default/css/print.css Failed to load resource: the server responded with a status of 404 (Not Found)
domain.com/:100 Uncaught TypeError: $(...).ready is not a function
VM111 prototype.js:1931Uncaught TypeError: Cannot read property 'style' of null
VM111 prototype.js:5734Uncaught TypeError: element.dispatchEvent is not a function

Please help me.


texts:
I am in the process of upgrading our Magento 2.2.5 website to version 2.3. I have managed to do this and the website works fine, as far as I can tell.

However, we have a third party extension for a Payment Gateway that is throwing errors at me.

I have been in touch with the developer and they have informed me that recent changes to Magento 2.3 have meant that anyone with a Prefix on their db tables is getting unique constraint violation errors.

They have informed me that the fact Magento limit characters to 32, because of the prefix everything afterwards is getting truncated.

I find it very strange how it worked before upgrading to 2.3 and updating their extension but there you go.

They have told me that I need to remove the DB Table Prefix.

I have done this in PHPMyAdmin using the 'Replace Table Prefix' option and then removed the Prefix from 'app/etc/env.php'.

The frontend and admin seem to be loading, haven't performed extensive testing yet... however I have two issues that I hope some might be able to assist with.

1:  There is a table in the database that I have not been able to remove the prefix for. The table is called 'PREFIX_inventory_stock_1' and it just says:
"#1347 - .PREFIX_inventory_stock_1' is not a base table."
When I try to replace the prefix with the 'Replace Table Prefix' option.

2: When I try to run php bin/magento setup:upgrade I get the following errors:

In Pdo.php line 235:
  SQLSTATE[42000]: Syntax error or access violation: 1235 This version of MySQL doesn't yet support 'multiple tri
  ggers with the same action time and event for one table', query was: CREATE TRIGGER trg_catalog_product_entity_
  after_insert AFTER INSERT ON catalog_product_entity FOR EACH ROW
  BEGIN
  INSERT IGNORE INTO catalogrule_product_cl (entity_id) VALUES (NEW.entity_id);
  INSERT IGNORE INTO catalog_product_price_cl (entity_id) VALUES (NEW.entity_id);
  INSERT IGNORE INTO catalogsearch_fulltext_cl (entity_id) VALUES (NEW.entity_id);
  END

In Pdo.php line 228:
  SQLSTATE[42000]: Syntax error or access violation: 1235 This version of MySQL doesn't yet support 'multiple tri
  ggers with the same action time and event for one table'

I apologise in advance that I am not a developer with a great depth of experience, so if there is something extremely obvious here then I am sorry.

Although I would really appreciate if any kind soul out there could point me in the right direction.

Thanks in advance :)

EDIT ---------------------

I have discovered another issue where all products have now vanished from the frontend of the website. I have checked in admin and all product information appears correct... note they appeared fine before removing the PREFIX.


texts:
My problem seems simple, but I actually spent 4 hours looking for the problem and can't find it.

I have a plug-in in magento to show a banner slider in my frontend page together with an image below the banner. My issue here is that, the image below the banner do not have hyper-links and still when you put the mouse over the image, an 1px grey border appears around it and it receives opacity.

I went throw every css file I found in my magento folder and could not find the source. The website is here

Is it possible to use the !important feature of css to solve the issue here?


texts: Magento 2 - looking for faster and better way to deploy static content

texts:
I am using a multi store setup with Arabic and English and everything is working well including building modules and template building.

However, if I make a change to any less file or JS file (despite using grunt less or grunt watch) I have to run the following commands on my development environment everything single time to see them on my local machine.

$ rm -rf var/cache var/page_cache var/view_preprocessed pub/static
$ php -dmemory_limit=1G bin/magento setup:static-content:deploy -f //even if I use --theme Mythemename -f
$ grunt exec less // sometimes I leave this do this
$ grunt // I swap between these

This takes a long time to do this process everytime. It is frustrating as I like to see CSS and Less immediately on the site and not wait around.

Surely there must be a quicker way for our deployment, development to work better and to see changes faster without downtime.

Even Magento 2 official documentation says your LIVE site needs to go into maintenance and downtime mode to publish content - this is not an option for us.


texts: How to get search result count in layer/view.phtml file?

texts:
I want to place a condition based on product count in layer navigation. I have tried with following code

file localtion : app/design/frontend/Custom/goshop/Magento_LayeredNavigation/templates/layer/view.phtml

$search_obj      = $objectManager->create('Magento\CatalogSearch\Block\Result');
echo "<pre>";print_r($search_obj->getResultCount());

Its giving error as follows

Fatal error:  Uncaught Error: Call to a member function getLoadedProductCollection() on boolean in /var/www/html/unicorn-magento/vendor/magento/module-catalog-search/Block/Result.php:182
Stack trace:
#0 /var/www/html/unicorn-magento/vendor/magento/module-catalog-search/Block/Result.php(206): Magento\CatalogSearch\Block\Result->_getProductCollection()
#1 /var/www/html/unicorn-magento/app/design/frontend/Custom/goshop/Magento_LayeredNavigation/templates/layer/view.phtml(30): Magento\CatalogSearch\Block\Result->getResultCount()
#2 /var/www/html/unicorn-magento/vendor/magento/framework/View/TemplateEngine/Php.php(59): include('/var/www/html/u...')
#3 /var/www/html/unicorn-magento/vendor/magento/framework/View/Element/Template.php(270): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\LayeredNavigation\Block\Navigation), '/var/www/html/u...', Array)
#4 /var/www/html/unicorn-magento/vendor/magento/framework/View/Element/Template.php(300): Magento\Framework\View\Element\Template->fetchView('/var/www/html/u...')
#5 in /var/www/html/unicorn-magento/vendor/magento/module-catalog-search/Block/Result.php on line 182

Please help me to get search result product count . Thanks in advance.


texts: function createOrders() logic in OverviewPost.php in module-multishipping

texts:
I got function createOrders() in file OverviewPost.php locate in module-multishipping like below.

$this->_getCheckout()->createOrders();

I could not find where createOrders() function locate, so where i could find that function?


texts: Mageto 2.4.2. Status is assigned to a state. How do I cancel assignment?

texts: Tried to clic on "cancel assign" button, but I get error: "The last status can't be changed and needs to stay assigned to its current state.".


texts:
I have 2 or 3 different bundle-type products. Generally they all appear the same in the catalog, with differing attribute sets showing/hiding available options.

It seems there will eventually be a bundle-type product with a vastly different template using a 1-column design as opposed to a 2-columns-right template. My first thought was to use custom layout xml, but all products added to this attribute set in the future will need the template.


texts:
To finish implementing a custom payment method I need to know how to convert the quote to the actual order.

From payment gateway, my custom controller is called.

Inside that controller, I can access Checkout Session object.

When I call getQuoteId on that object, I get the actual quote id, however, when I call getLastRealOrderId, nothing is returned, so I think I need to do a previous step first.

I have read https://mage2.pro/t/topic/732 and https://mage2.pro/t/topic/731 but those sites only shows code, with no explanation, so I need a little guide to use method calls shown there.

The order should be created in both when failure and success payment occured.

Furthermore, when success payment, the confirmation e-mail for customer should be sent automatically.

How can I do it?

EDIT:

This is a controller that is called using $.post jquery method:

class Store extends \Magento\Framework\App\Action\Action {

/**
 * @var \Psr\Log\LoggerInterface
 */
protected $_logger;

/**
 * @param \Magento\Framework\App\Action\Context $context
 * @param \Psr\Log\LoggerInterface $logger
 */
public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Psr\Log\LoggerInterface $logger
) {
    $this->_logger = $logger;
    parent::__construct($context);
}

/**
 * Almacena los datos para posterior recuperacion
 *
 * @return void
 * @SuppressWarnings(PHPMD.ExitExpression)
 */
public function execute() {
    if (!$this->getRequest()->isPost()) {
        return;
    }

    try {
        $data = $this->getRequest()->getPostValue();
        ----
    }
    } catch (RemoteServiceUnavailableException $e) {
        $this->_logger->critical($e);
        $this->getResponse()->setStatusHeader(503, '1.1', 'Service Unavailable')->sendResponse();
        /** @todo eliminate usage of exit statement */
        exit;
    } catch (\Exception $e) {
        $this->_logger->critical($e);
        $this->getResponse()->setHttpResponseCode(500);
    }
}

Quote Id is received by POST method in execute() function. I need to be able to create the order from there. How can I define the constructor in the proper way? I am thinking that maybe constructor parameters are specified as @params comments, aren't they? I would found this to be strange, since those are comments in PHP, but maybe Magento uses that information to do such a definition.


texts: catalog_product_entity_media_gallery in mysql is missing

texts:
I'm using magento 1.8,
I want to import products with a csv file. the file is okay, but i get this error:

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`databasename`.`catalog_product_entity_media_gallery`, CONSTRAINT `FK_CAT_PRD_ENTT_MDA_GLR_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DE)

I checked this in phpmyadmin and the table 'catalog_product_entity_media_gallery' is missing. what can I do now?


texts: How to create a custom module for image and video upload in Admin product page magento2.2.5?

texts:
I want to create a custom module for image and video upload in Admin product page magento2.2.5?

Any help would be appreciated.


texts:
I ran one of overly aggressive scripts which deleted the product images.

I did have a backup, so how can I restore them?


texts:
I am trying to logout user

I used following code

<?php
require_once 'app/Mage.php';
Mage::app();
Mage::getSingleton('customer/session')->logout();
?>

But it's not working

Please help me to solve this.


texts: How can I exclude a folder from a command line backup

texts:
I'm doing a command line backup of the file system with bin/magento setup:backup --code,

but I have one directory which contains a lot of large image files that I would like to exclude.

Is there a way to configure my file system backups to exclude a directory?


texts: How to replace direct use of Object Manager?

texts:
in the success.phtml file I currently have a direct use of the object manager, which I am now reading is not best practice. I was wondering how to make a constructor to replace the following code in accordance with Magento best practices.

    $oid = $this->getOrderId();
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $order = $objectManager->create('Magento\Sales\Model\Order')->load($oid);


texts: Getting error when flushing Swatch Images Cache

texts:
I am trying to flush swatch images cache but it shows error message:

  An error occurred while clearing the configurable swatches image
  cache.

This exception is showing on exception.log file:

  Exception message: Warning:
  include(Mage/Configurableswatches/Helper/Productimg.php): failed to
  open stream: No such file or directory"


texts:
I manage to obtain the creditmemos in pdf format via this code (for a webservice)

$result = array();
//.....
//....

Mage::app()->setCurrentStore($store_id); // my store id

$CreditMemo = Mage::getResourceModel('sales/order_creditmemo_collection')
        ->addAttributeToSelect('*')
        ->addAttributeToFilter('entity_id', array('in' => $creditmemo_id))
        ->load();
if ($CreditMemo->getSize() > 0) {
  $pdf = Mage::getModel('sales/order_pdf_Creditmemo')->getPdf($CreditMemo);
  if ($pdf) {
    $file = $pdf->render(); // get the pdf content
    $result['file'] = base64_encode($file); // convert it to 64
  }
}

return $result; //return result in soap

But it doesnt apply the same template as in the frontend.

I use a similar code to generate PDF invoices and do not encounter this problem....

Do you know how to define the template for creditmemos ?

Thanks;


texts: Change the name of a button in Checkout Form In magento1.9.2.2

texts:
I want to change the name of my continue button in Checkout form but I couldn't able to find the path. The image below will show you the button.

Help Me to find it


texts:
The button in my module:

system.xml

                <update translate="label">
                    <frontend_type>button</frontend_type>
                    <frontend_model>mateusvitali_sigepweb/button</frontend_model>
                    <sort_order>300</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>1</show_in_store>
                </update>

I want to call a method (php) by clicking on the button. I created the class MateusVitali_SigepWeb_Block_Button too.

Ok, I tried to follow this tutorial:
http://www.atwix.com/magento/add-button-to-system-configuration/

But the method is not called and the alert does not appear.

app/design/adminhtml/default/default/template/MateusVitali/system/config/updateButtin.phtml

<script type="text/javascript">
    //<![CDATA[
    function update() {
        new Ajax.Request('<?php echo $this->getAjaxCheckUrl() ?>', {
            method:     'get',
            onSuccess: function(transport){
                if (transport.responseText){
                    alert('Updated!');
                }
            }
        });
    }
    //]]>
</script>

<?php echo $this->getButtonHtml() ?>

app/code/local/MateusVitali/SigepWeb/Controllers/Adminhtml/MateusVitaliSigepWebController.php

class MateusVitali_SigepWeb_Adminhtml_MateusVitaliSigepWebController extends Mage_Adminhtml_Controller_Action
{
    /**
     * Return some checking result
     *
     * @return void
     */
    public function updateAction()
    {
        $result = 1;
        Mage::app()->getResponse()->setBody($result);
    }
}

app/code/local/MateusVitali/SigepWeb/Block/Button.php

class MateusVitali_SigepWeb_Block_Button extends Mage_Adminhtml_Block_System_Config_Form_Field
{
    /*
     * Set template
     */
    protected function _construct()
    {
        parent::_construct();
        $this->setTemplate('mateusvitali/system/config/updateButton.phtml');
    }

    /**
     * Return element html
     *
     * @param  Varien_Data_Form_Element_Abstract $element
     * @return string
     */
    protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
    {
        return $this->_toHtml();
    }

    /**
     * Return ajax url for button
     *
     * @return string
     */
    public function getAjaxCheckUrl()
    {
        return Mage::helper('adminhtml')->getUrl('adminhtml/adminhtml_mateusvitalisigepweb/update');
    }

    /**
     * Generate button html
     *
     * @return string
     */
    public function getButtonHtml()
    {
        $button = $this->getLayout()->createBlock('adminhtml/widget_button')
            ->setData(array(
            'id'        => 'update_button',
            'label'     => 'Atualizar Serviços',
            'onclick'   => 'javascript:update(); return false;'
        ));

        return $button->toHtml();
    }
}


texts: 2 different Online-Shops in one Magento with same stock management

texts: Is it possible to have 2 complete different shops (different product page but same products)? The on stock management should be same for both shops.


texts:
Made a simple module. But in trying to view the url I get this error.

  Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element >'referenceBlock', attribute 'after': The attribute 'after' is not allowed.
  Line: 827

Looks similar to other known issues but not exactly the same. Any Ideas?


texts: Magento using setCurPage for reviews pagination

texts:
I'm using the allreviews Magento extension so that I have a page with all reviews however I need to add pagination to this page.

The last bit I'm stuck with is essentially adding the limit to the query. I've read a number of threads that say to use setCurPage on the collection but this doesn't seem to affect the query at all?

When I try what should equal LIMIT 25, 25 and LIMIT 75,25 etc I still get the result from LIMIT 0, 25

Current query:

//$_GET['product'] = 1;    //product id
$numberOfReviews = 25;     //per page
$page = 3;                 //page

$_reviews = Mage::getModel('review/review')
                        ->getCollection()
                        ->addFieldToFilter('entity_pk_value', $_GET['product'])
                        ->addStoreFilter(Mage::app()->getStore()->getId())
                        ->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED)
                        ->setDateOrder('desc')
                        ->setPageSize($numberOfReviews)
                        ->addRateVotes()
                        ->setCurPage($page);

What am I doing wrong?


texts:
I have just installed fresh version of Magento 2 locally with XAMPP but the admin panel shows me a blank screen

This is a screenshot of the problem:


texts: How to get/access subdomain name in code

texts:
How to get or access subdomain name in code.
Magento verion 2.3


texts: How to create a tab content dynamically in magento?

texts:
I have created a tab at cms/block at admin panel along with the javascript like this:

Details

Care

 {{block type="core/template" template="catalog/product/view/description.phtml"}}

Tab #2 content goes here!

 online store.


texts: cron.php running twice even though cron.sh runs once

texts:
I have a cron job set up to run the cron.sh file every 5 minutes, as per the installation guide. I have checked the server's cron log history and it is correctly running the job on schedule.

I added file_put_contents('cronlog.txt', date('c') . "\n", FILE_APPEND); to the end of the try block in cron.php to verify, but it's logging two identical dates every 5 minutes, like cron.php is calling itself recursively.

Is this normal behaviour? If not, any ideas as to what could cause such strangeness?


texts: How to hide all stock statuses in the store?

texts:
I don't need the admin option. I want to hide statuses for special custom groups and for specific websites.
I want to add to the product page and category view_model which has a method in it that I want to add to the template. I try to do ATK but it doesn't work. Tell me how to do it
app/design/frontend/Tttt/eee/Magento_Catalog/layout/catalog_product_view_type_simple.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <block class="Magento\Catalog\Block\Product\View\Type\Simple" name="product_type_data">
            <arguments>
                <argument name="view_model" xsi:type="object">Tttt\Catalog\ViewModel\StockStatusDisplay</argument>
            </arguments>
        </block>
    </body>
</page>

app/design/frontend/Tttt/eee/Magento_Catalog/templates/product/view/type/default.phtml
<?php if ($block->getViewModel()->getMyMethod()): ?>


texts:
i'm trying to create a taxe rules that for same products add different tax.

The price of my products is whitout tax (excludind tax) for example 100 €

I would like that for example for my customer in Italy (since we are in italy) they pay 100+Tax(22%), instead my customer in Spain i would like they pay just 100 €

Can you help me to create these tax rules

Thank you very much
Ivan


texts: Newsletter subscription validation messages are not displaying on front end

texts:
I am using custom theme for my site, I bit stuck with newsletter subscription.

whenever I subscribe for news letter with same email id which is already subscribed, It should show the error, But I am not able to see any error message or success message in front end.

my subscribe.phtml code is

<form action="<?php echo $this->getFormActionUrl() ?>" method="post" id="newsletter-validate-detail" class="newsletter">
    <div class="form-group has-feedback">
         <input type="text" name="email" id="newsletter" title="<?php echo $this->__('I want to receive the specials') ?>" class="input-text required-entry validate-email form-control "/>
        <button type="submit" class="newsletter_button form-control-feedback button"><?php echo $this->__('OK') ?></button>
    </div>
</form>
<script type="text/javascript">
//<![CDATA[
    var newsletterSubscriberFormDetail = new VarienForm('newsletter-validate-detail');
//]]>
</script>

and I also use this code to display the error, in subscribetionController

$emailExist = Mage::getModel('newsletter/subscriber')->load($email, 'subscriber_email');
                if ($emailExist->getId()) {
                Mage::getSingleton('core/session')->addError('Error sending mail');
                    //Mage::throwException($this->__('This email address is already exist.'));
                }

I am not what is mistake here, But I am thinking I am not able to print the error message at front end,

Any suggestions, ?
Help Me:)
Thanks in advance..


texts: magento set "catalog price rules" *only* if special price was not set

texts:
I am looking at magento "catalog price rules" and although I have added the special_price to filter conditions: I dont think I can do the following

question:
How can I only apply the "catalog price rules" if the special_price was not already set

Aim: target only products that do not already have a special price set

http://docs.magento.com/m1/ce/user_guide/marketing/price-rules-catalog.html


texts: Is there any way to get list of all coupon codes which are available to the cart will be displayed in the Cart Page ?


texts: How to add other pages to search results besides just products

texts: Does anyone have any idea where I would start regarding having CMS pages show up in search results, not just products on the front end? I know you can do a redirect with a keyword, but I don't want to do that. I want the CMS page to actually show up in the search results.


texts: The meaning of "constrainOnly" in \Magento\Catalog\Helper\Image

texts:
The image help can resize the image, but I don't understand the constrainOnly parameter in it. What is the function of ->constrainOnly(true) and ->constrainOnly(false)?

code example

return $this->_imageHelper
        ->init($product,'category_page_list')
        ->constrainOnly(FALSE)
        ->keepAspectRatio(TRUE)
        ->keepFrame(FALSE)
        ->resize(240, 300)


texts: Magento 2: Safari (only) TypeError for window object

texts:
Can anyone explain why I'm receiving this error on the Cart page on Safari:

TypeError: undefined is not an object (evaluating 'window.checkoutConfig.quoteData')

This happens intermittently and not every time the page loads. Interestingly, it never occurs if the page is refreshed, only if i access the page by hitting return in the browser URL input.

Though it only happens once in a while, it kills the rest of my JS from executing, so I need to find a solution.


texts: Magento 2.3.4 - Missing key 'cardNumber'

texts:
After the checkout is completed I receive an error:

main.ERROR: Missing key 'cardNumber' from checkout form [] []

Please could you advise?


texts: Porto theme - Uncaught TypeError: e(...).stellar is not a function in magento 2

texts:
we have installed porto theme, after that the console throws following issues

I have followed this link https://www.magemonkeys.com/smartwave-porto-theme-show-an-error-like-this-in-browser-console-and-my-page-not-load-properly/ , but no luck
Thanks in advance


texts: How can I create Admin(Manual) order without the Products available in the Website?

texts: I need to create manual(Admin) order, without the products present in the website, I mean order create for not available products in website. How to achieve using any custom options?


texts: Magento 2.2.x: Persistent Checkout can't be disabled

texts:
The problem is even when i disable the "persistent checkout", it still work as normal.
Its a magento default module, so i think this is a magento 2 bug.

After a day working on this, i still don't know how this work. I mean i guess they use cookie or session to store the cart after customer log out.
Then after guest login, they will use that session or cookie to update the cart.
But i don't know how they do that.

The module is "module-persistent" (default magento module).
Thanks.


texts: xml of config is incomplete (countries not shown)

texts:
I'm having problems with showing the countries in my magento website. When you want to give in you're billing address it's required to give in your country. The problem is that the countries are empty :

As you can see the select list is empty. But in my backend I have the following allowed countries:

That's my default config and I use it for the website, nl and fr store:

In my config in my database you can also see it:

INSERT INTO `pp_core_config_data` (`config_id`, `scope`, `scope_id`, `path`, `value`)
VALUES
    (14, 'default', 0, 'general/country/allow', 'AF,AX,AL,DZ,AS,VI,UM,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AZ,BS,BH,BD,BB,BE,BZ,BJ,BM,BT,BO,BA,BW,BV,BR,IO,VG,BN,BG,BF,BI,KH,CA,KY,CF,CL,CN,CX,CC,CO,KM,CG,CD,CK,CR,CU,CY,DK,DJ,DM,DO,DE,EC,EG,SV,GQ,ER,EE,ET,FO,FK,FJ,PH,FI,FR,GF,PF,TF,GA,GM,GE,GH,GI,GD,GR,GL,GP,GU,GT,GG,GN,GW,GY,HT,HM,HN,HU,HK,IS,IE,IN,ID,IQ,IR,IM,IL,IT,CI,JM,JP,YE,JE,JO,CV,CM,KZ,KE,KG,KI,KW,HR,LA,LS,LV,LB,LR,LY,LI,LT,LU,MO,MK,MG,MW,MV,MY,ML,MT,MA,MH,MQ,MR,MU,YT,MX,FM,MD,MC,MN,ME,MS,MZ,MM,NA,NR,NL,AN,NP,NI,NC,NZ,NE,NG,NU,KP,MP,NO,NF,UG,UA,UZ,OM,TL,AT,PK,PW,PS,PA,PG,PY,PE,PN,PL,PT,PR,QA,RO,RU,RW,RE,BL,KN,LC,PM,VC,SB,WS,SM,ST,SA,SN,RS,SC,SL,SG,SH,MF,SI,SK,SD,SO,ES,LK,SR,SJ,SZ,SY,TJ,TW,TZ,TH,TG,TK,TO,TT,TD,CZ,TN,TR,TM,TC,TV,UY,VU,VA,VE,GB,AE,US,VN,WF,EH,BY,ZM,ZW,ZA,GS,KR,SE,CH');

When I debug it with xDebug I can see the config variable with an _xml property:

The path of the config value is general/country/allow and the full path (for specific store) is stores/nl/general/country/allow.

But when I check stores/general/ there's only locale and NOT country. What could be the reason for this? I'm really stuck with this and I have no clue what's causing this ... .

I'm using Magento ver. 1.7.0.2 . (Also maybe good to know: this worked on another server, but when we cloned it to our server it doesn't work anymore ..)


texts: Host venia theme on server but generated secure url not run on other devices

texts:
Generate ssl certificate for CUSTOM_ORIGIN_EXACT_DOMAIN=www.pwa.com using command yarn buildpack create-custom-origin packages/venia-concept.

after excuting the yarn run build && yarn run stage:venia generate the secure url like https://www.pwa.com but this secure the url only run securely for my own pc but on another devices not run becuase of invalild certificate.


texts: I have create system.xml for system config value but not work

texts:
I have created one extension now i released i have also need some system config value where user can easily to handle this module. so i have created system.xml in adminhtml folder but its not work correctly.

Below my system.xml code

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
        <tab id="dd_invoice" translate="label" sortOrder="10">
            <label>DD</label>
        </tab>
    </system>
</config>

Please check Reply on this if any changes are needed.

Thanks


texts:
I can get information regarding orders using 3rd party API but when I want to save it into 3 tables, for sales_flat_order and sales_flat_order_adress the data has been saved and for sales_flat_order_grid I've gotten this error I think that I want to save the Parent_id in the entity_id as it should be same. But I don't know how.

Fatal error:  Uncaught exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`magento`.`sales_flat_order_grid`, CONSTRAINT `FK_SALES_FLAT_ORDER_GRID_ENTITY_ID_SALES_FLAT_ORDER_ENTITY_ID` FOREIGN KEY (`entity_id`) REFERENCES `sales_flat_order` (`entity_id`) ON DELETE CA)' in D:\wamp\www\magento1.9\lib\Zend\Db\Statement\Pdo.php:228

this array that I want to save for 3 tables

Foreach($array as $value){
                    $array = array('status' => $value['status'],
                 'base_grand_total' => $value['price'],
                 'grand_total' => $value['price'],
                 'increment_id' => $value['number'],
                 'base_currency_code' => 'MXN',
                 'customer_email' => $value['email'],
                 'customer_firstname' => $value['name'],
                 'customer_lastname' => $value['apellido'],
                 'global_currency_code' => 'MXN',
                 'order_currency_code' => 'MXN',
                 'store_name' => 'linio marketplace',
                 'created_at' => $value['created'],
                 'updated_at' => $value['created'],
                 'total_item_count' => $value['item']);
                  $modele = Mage::getModel('thorleif/order')->setData($array);
                  $modele->save();
                 $id = $modele->getId();
                 $array = array(
                 'parent_id' => $id,
                 'region' => $value['region'],
                 'postcode' => $value['zip'],
                 'street' => $value['address'].'.'.$value['country'],
                 'city' => $value['city'],
                 'email' => $value['email'],
                 'telephone' => $value['tel'],
                 'firstname' => $value['name'],
                 'lastname' => $value['apellido'],
                 'address_type' => 'shipping');
                  $modele = Mage::getModel('thorleif/address')->setData($array);
                  $modele->save();
                  $array = array(
                 'parent_id' => $id,
                 'status' => $value['status'],
                 'base_grand_total' => $value['price'],
                 'grand_total' => $value['price'],
                 'increment_id' => $value['number'],
                 'base_currency_code' => 'MXN',
                 'shipping_name' => $value['name'],
                 'global_currency_code' => 'MXN',
                 'order_currency_code' => 'MXN',
                 'store_name' => 'linio marketplace',
                 'created_at' => $value['created'],
                 'updated_at' => $value['created']);
                  $modele = Mage::getModel('thorleif/grid')->setData($array);
                  $modele->save();
                 }


texts: Remove field in Customer Account Information

texts:
I am trying to remove the Associate to Website field on the following page:

Customers -> Manage Customers -> Click on a customer -> Account Information

I have checked Mage_Adminhtml_Block_Customer_Edit_Tab_Account::initForm() in this file:

app/code/local/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php

but I am unsure how it loads the fields and how to remove a field.


texts:
I'm trying to add a drop_down custom option to my products and am apparently forgetting an element in the array for options. I tried adding value and values but neither remove the error:

  Uncaught exception 'Mage_Core_Exception' with message 'Select type
  options required values rows.'

This is what I have so far:

require_once 'app/Mage.php';
Mage::app('default');

$productIds = array(29);

$option = array(
    'title' => 'Test Option',
    'type' => 'drop_down',
    'sort_order' => 1,
    'values' => 230, // not working!
    'is_require' => 1,
    'price' => 10,
    'price_type' => 'fixed',
    'sku' => 'testsku'
);

foreach ($productIds as $productId) {
    $product = Mage::getModel('catalog/product')->load($productId);
    $optionInstance = $product->getOptionInstance()->unsetOptions();

    $product->setHasOptions(1);
    if (isset($option['is_require']) && ($option['is_require'] == 1)) {
            $product->setRequiredOptions(1);
    }
    $optionInstance->addOption($option);
    $optionInstance->setProduct($product);
    $product->save();
}

Does anyone see something wrong?


texts: Custom email template, use user id. Magento 2.3.4

texts:
I want to use user id/name in custom emails, when i use {{trans "% name," name = $ user.name}} , i get empty field.

Do I have to create custom variables for this data?


texts: Different template variations in magento categories

texts:
I want different versions of my template (different header CSS mainly) for different categories, i am using the "porto" template. how can i do this in CE 1.9?

I have made and copied the default folder out of skin/frontend and renamed it but it doesnt show in the categories custom design dropdown.

Thank you in advance


texts: Magento 2 disable file preview in admin form

texts:
I created grid form using UI component. In my UI form I use file uploader. How can I disable image preview? Because I upload pdf file and preview are showing blank square.
My form field

<field name="journal_pdf">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="dataType" xsi:type="string">text</item>
                <item name="source" xsi:type="string">Journal</item>
                <item name="label" translate="true" xsi:type="string">Journal PDF File</item>
                <item name="visible" xsi:type="boolean">true</item>
                <item name="formElement" xsi:type="string">fileUploader</item>
                <item name="has_preview" xsi:type="string">false</item>
                <item name="required" xsi:type="boolean">false</item>
                <item name="sortOrder" xsi:type="number">40</item>
                <item name="dataScope" xsi:type="string">journal_pdf</item>
                <item name="uploaderConfig" xsi:type="array">
                    <item name="url" xsi:type="url" path="vendorname_modulename/journal/savejournal"/>
                </item>
            </item>
        </argument>
    </field>


texts: Unable to run Jmeter perfomance-toolkit for magento 2

texts:
I am trying to run the jmeter benchmark.jmx in setup/performace-toolkit of Magento 2.

The tests are failing trying to log into the admin. The login form is posted to ${base_path}${admin_path}/admin/dashboard/ but this results in a 302 If I change the path to: /index.php/admin/admin/index/index/key/29beedceb1eb856caffd426b4099ebb8a466a8d318536808181062ab066f79c4/
the login is successful.

The problem appears to be that the JMeter tests are not using the key parameter.

Is this a problem with the JMeter tests or am I missing a configuration option within magento which removes then need for a key.


texts: I am using gift card to buy products in my store, but after pressing "continue" occurs error "pleace specify payment method"


texts: Why do some of my products not have a custome price check box when creating an order from the admin side? Magento 2.4

texts:
When creating an order in Magento 2.4

Some of my products will have a custom price check box, and some of them won't. The attributes for each are exactly the same. The only difference is the name. Is there a setting I'm missing that wouldn't allow a product to have a custom price check box?
There are no advanced pricing rules set up for either product.


texts:
I have set cron job but any emails are not send.

Below is my crontab. It is running but emails are not send.

Suggest me some solution.

*/1 * * * * /usr/bin/php -c /etc/php5/apache2/php.ini /var/www/magento2/bin/magento cron:run > /var/www/magento2/var/log/magento.cron.log&

*/1 * * * * /usr/bin/php -c /etc/php5/apache2/php.ini /var/www/magento2/update/cron.php > /var/www/magento2/var/log/update.cron.log&

*/1 * * * * /usr/bin/php -c /etc/php5/apache2/php.ini /var/www/magento2/bin/magento setup:cron:run > /var/www/magento2/var/log/setup.cron.log&


texts: Configurable product selectable attribute

texts:
This question is related to a previous one I asked here: Simple vs Virtual Products for Virtual Products as Configurable Products

While creating a configurable product to associate our products with I forgot that I have to create a selectable option. That would seem trivial for something like a shirt size or color.

In our case, the selectable option is the price of the associated product – think calling card or gift card denomination.

Is it possible, or is there a similar solution I'm not considering, that would allow us to create configurable products based on (virtual) associated products' prices or names?

The reason we want to use individual products over custom options is to have the ability to track inventory of individual products and, more importantly, to be able to assign attributes to the individual denominations. One example of this would be an attribute that assigns a particular denomination to a particular fulfillment warehouse; where some denominations (selectable options) of a configurable product might be filled from warehouse A, some from warehouse B, and some from C. The "warehouses" are essentially different API integrations.


texts: What is real use of vendor/magento/module-eav/Model/Entity/Increment/ classes

texts: I have found some classes under vendor/magento/module-eav/Model/Entity/Increment/, which use I am not sure. Do they serve for incrementing id's values of new rows in EAV tables? Or this process is fullfilled by mysql?


texts: Creating a Customer Attribute set by Dropdown Populated from a table

texts:
I have a custom module that created the table Namespace_Module_Rep_Directory_Rep. In this table we have a set of locations with entity_id, name, email, phone, status.

I want to be able to assign each customer to a rep. I know how to make customer attributes, but I am unsure how to make one that is linked to this table. I want to be able to go to a customer, and for "Rep" select a rep from a dropdown menu populated with the names of the reps from Namespace_Module_Rep_Directory_Rep.

I have looked all over for tutorials or similar setups, but have yet to find anything really useful. If anyone can provide some insight on how to accomplish this or a site that may help me I'd appreciate it, thanks.

Update:

I have followed @Marius's answer and have run into a problem implementing it. When I go to edit a customer, I get the error:
"Source model "namespace/attribute_source_module" not found for attribute "module"

It seems to be unable to find the model with the options for the select, so it errors out. I followed the example here, which @Marius provided.

Namespace/Module/etc/config:

...
    <global>
        <models>
            <module>
                <class>Namespace_Module_Model</class>
            </module>
        </models>

...

Namespace/Module/Model/Attribute/Source/Module.php:

<?php
class Namespace_Module_Model_Attribute_Source_Module extends Mage_Eav_Model_Entity_Attribute_Source_Abstract{
    protected $_options = null;
    public function getAllOptions($withEmpty = false){
        if (is_null($this->_options)){
            $this->_options = array();

            $this->_options[] = array('label'=> $this->__('Option 1'), value=>1);
            $this->_options[] = array('label'=> $this->__('Option 2'), value=>3);
            $this->_options[] = array('label'=> $this->__('Option 3'), value=>3);
        }
        $options = $this->_options;
        if ($withEmpty) {
            array_unshift($options, array('value'=>'', 'label'=>''));
        }
        return $options;
    }
    public function getOptionText($value)
    {
        $options = $this->getAllOptions(false);

        foreach ($options as $item) {
            if ($item['value'] == $value) {
                return $item['label'];
            }
        }
        return false;
    }
}

 Namespace/Module/sql/module_steup/install-0.1.0.php

<?php
$installer = $this;

$installer->startSetup();

$setup = new Mage_Eav_Model_Entity_Setup('core_setup');

$entityTypeId     = $setup->getEntityTypeId('customer');
$attributeSetId   = $setup->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = $setup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);

$installer->addAttribute("customer", "module",  array(
    "type"     => "int",
    "backend"  => "",
    "label"    => "Module",
    "input"    => "select",
    "source"   => "module/attribute_source_module",
    "visible"  => true,
    "required" => false,
    "default" => "",
    "frontend" => "",
    "unique"     => false,
    "note"       => "Module"

        ));

        $attribute   = Mage::getSingleton("eav/config")->getAttribute("customer", "module");

$setup->addAttributeToGroup(
    $entityTypeId,
    $attributeSetId,
    $attributeGroupId,
    'module',
    '999'  //sort_order
);

$used_in_forms=array();

$used_in_forms[]="adminhtml_customer";
//$used_in_forms[]="checkout_register";
//$used_in_forms[]="customer_account_create";
//$used_in_forms[]="customer_account_edit";
//$used_in_forms[]="adminhtml_checkout";
        $attribute->setData("used_in_forms", $used_in_forms)
                ->setData("is_used_for_customer_segment", true)
                ->setData("is_system", 0)
                ->setData("is_user_defined", 1)
                ->setData("is_visible", 1)
                ->setData("sort_order", 100)
                ;
        $attribute->save();

$installer->endSetup();


texts: How to filter product collection using array of attributes and values

texts:
I am trying to filter the productCollection using attribute and values arrays, but it it showing error, here below is my code. Please, let me know how it can be done...

$requestParams = $this->getRequest()->getParam('requestParams');
$shoppingBy = $requestParams["shoppingBy"];

$attributeCodes = array_keys($shoppingBy);

$productCollection = Mage::getModel("catalog/category")
->load($requestParams['categoryId'])
->getProductCollection();

foreach($attributeCodes as $attributeCode) {
    $attributeValue = $shoppingBy[$attributeCode];
    $filter = array('attribute' => $attributeCode, 'in' => $attributeValue);
    $productCollection = $productCollection->addAttributeToFilter($filter);
}


texts: Magento 2: User and admin sign up without password validation

texts:
Magento 2.1.7

User sign in with whatever password, also same admin logged in whatever password.

user and admin sign in without password validation

We are using godaddy dedicated server.

Two Case here

Customer user sign in at store. ex. customer user: abc@gmail.com and customer password is clear@2015. when customer enter password Focus!2018@ with abc@gmail.com user. then sign in with that password Focus!2018@ instead of that password clear@2015.
same scenario/situation with admin user


texts: Why after deploying static content I'm receiving 404 to merged css?

texts:
I'm using Magento 2.3.3, after deploying some category pages are getting the wrong css, returning 404, I tried flushing the cache but it didn't work.

How could I solve it?


texts: Configurable product with simple products

texts:
I have a configurable product with 3 simple products. On my configurable product, I would like when someone selects an option from dropdown, the content to be changed. I mean some images should be changed and the product description. I tried something with simple products associated to configurable to be visible individually, but the client wants to have the dropdown on a simple products.
Is there any way to achieve this quickly? What solution do you have?
Thanks,


texts:
My problem is that only few configurable products have JS error on their page while its still same format just different description, price etc. The product tabs are not working and the content of all 3 tabs is shown straight away as well as the menu is not functioning. The error I could get from Firebug is:

SyntaxError: JSON.parse: expected ':' after property name in object at line 1 column 23 of the JSON data
...trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@"...

If I create a configurable product and not link associated products its okay, same for the simple products individual pages but when I associate them and try to view it again this problem arises, even though other configurable products are shown correctly.

I thought of some illegal char inside description etc but couldn't find something, any ideas?

Thank in advance.


texts: How can I differentiate between B2B and B2C?

texts:
I would like that in some step of purchase of Magento 2.2.4 could filter depending on the price that is in the cart and ask me some fields or not, I make an example:

Final Client B2C: When the purchase is over € 1000 you have to apply for the DNI / NIF or to register. We go for purchases over € 1000 that the user is registered, a user "guest" can not make a purchase over € 1000
B2B final client: When the purchase is over € 100, the user will be more sure to ask for the de-taxing of the order, which is why the CIF would be necessary and oblige him to register.

Therefore, it will always be differentiate what kind of user it is and what rule to apply according to the user, as far as I understand.

What I have not seen any extension information let do that. I do not know if you could help me or give me another option on how to do it

Thank you,


texts: Retrieving Layered Navigation / Category Filters via REST API / Outside Magento 1.9?

texts:
I am building mobile apps integrated with Magento via REST APIs. I have completed the app and created a lot of custom APIs for this purpose. I am now stuck in fetching filterable attributes and associated options for a category listing.

I am aware Magento uses the catalog/layer model for this purpose in the frontend. Most of it is done using blocks. I am not sure how to use this from API since there is no concept of layout here. Correct me if I am wrong.

The app's requirement is this.

There are categories listed in the app.
Clicking on a category will list all the products in that category.
There is a filter button which when clicked should show all available
filters for that particular products listed (results).
Further, clicking on each filter should fetch the relevant products
and the filters will get changed based on whether there are products
for a particular attribute's option.

I am able to do this by calling the Magento functions directly. But it is very heavy. Taking forever to load. This is what I am doing.

Get all categories using the id.
Get all filterable attributes in Magento
Get all options for each attribute
Load the product collection for each option to determine whether this option has any products in it and to get the count of products.
Return the products
Return all attributes and options with count.

I cannot do this way obviously because it is too heavy and taking 1 minute to repond for for 5k products and many attributes. In fact there are 3 for loops.

Does anyone know the right way?


texts:
I'm having a very hard time collecting the right totals when creating an order by code (magento 1.9, php5.4). I'm creating a quote as you noramlly would, added products and shipping/billing address, and now I'm collection the subtotal/shipping/taxes/grandtotal, and im not getting the right calculations.

For the example below, I have the following:

Product Price is 100
Taxes on Product Price is 25
Shipping Amount is 10
Shipping Taxes is 2.5
Grand total should be 137.5

When when executing $quote->collectTotals(); to get the order grand total, im always getting 110 for $quote->getGrandTotal() or $quote->getShippingAddress()->getGrandTotal(). I should be getting 137.5.

So I google around and did my homework, and apparently there was a problem in the order of the collection, so magento was collecting using the following order:

tax_shipping
nominal
subtotal
freeshipping
tax_subtotal
weee
shipping
discount
grand_total
msrp
tax

and the following total amounts were calculated:

So it looked like grand_total was calculated before adding the tax, and this is why I was getting 110 instead of 137.5, which makes sense, since all what the grand total class does is to sum up the total:

class Mage_Sales_Model_Quote_Address_Total_Grand extends Mage_Sales_Model_Quote_Address_Total_Abstract
{
    /**
     * Collect grand total address amount
     *
     * @param   Mage_Sales_Model_Quote_Address $address
     * @return  Mage_Sales_Model_Quote_Address_Total_Grand
     */
    public function collect(Mage_Sales_Model_Quote_Address $address)
    {
        $grandTotal     = $address->getGrandTotal();
        $baseGrandTotal = $address->getBaseGrandTotal();

        $store      = $address->getQuote()->getStore();
        $totals     = array_sum($address->getAllTotalAmounts());
        $totals     = $store->roundPrice($totals);
        $baseTotals = array_sum($address->getAllBaseTotalAmounts());
        $baseTotals = $store->roundPrice($baseTotals);

        $address->setGrandTotal($grandTotal+$totals);
        $address->setBaseGrandTotal($baseGrandTotal+$baseTotals);
        return $this;
    }

So I though if I changed the order of the collection, by moving the grand_total collection after the tax collection, this would solve my problem, so used i overrode the order using this simple extension https://github.com/hartmut-co-uk/magento-php7-totals-fix, after all it looked like a lot of people are facing the same issue with PHP7 and PHP5.5, although im using PHP5.4, i thought i would give it a shot, considering how desperate i am.

Now things are a bit different, the collection total changed to:

nominal
freeshipping
tax_subtotal
msrp
subtotal
weee
shipping
tax_shipping
discount
tax
grand_total

So I though all my problem went away, but for some reason, now the tax are not calculated the right way, I'm getting 2.5 for the tax instead of 27.5

I know the post is super long and can be hard to follow, but hopefully I was able to explain the problem. So the first question is:

Why grand_total collector is not called in the right order in the first place.
I have no idea what to do next. Suggestions are strongly welcomed :D.


texts:
I am new to the Magento, so not sure how we can implement this
I want to send ajax request on Add to cart button on product detail page where I have to send the request to get stock from third party API.


texts: Magento 1.9 template file calling from base and not from my custom theme

texts:
In Magento 1.9 I have created my custom theme.

Also, I have created one new module in the 'local' code pool.

Everything workes fine but the template files are loading from the base like

frontend/base/default/template/training/customer/view.phtml

it should be load from

frontend/allure/default/template/training/customer/view.phtml

this is my layout.xml

app/design/frontend/allure/dream/layout/training.xml

<?xml version="1.0" ?>
<layout version="0.1.0">

    <customer_account>
        <reference name="customer_account_navigation">
            <action method="addLink" translate="label" module="training">
                <name>training</name>
                <path>training/customer/view</path>
                <label>Training</label>
            </action>
        </reference>
    </customer_account>

  <training_customer_view>
            <update handle="customer_account"/>
            <reference name="content">
                <block type="training/customer" name="view.training" template="training/customer/view.phtml"/>
            </reference>
   </training_customer_view>

</layout>

If anyone knows why this is happening>


texts: Sort by attibute not working with Yes/No attribute type

texts:
I am trying to sort the product listing by one attribute "best_seller". Attribute type is Yes/No , Now i need to sort product by the best_seller and need to show the best seller products set as Yes to appear first on the list. I already set this attribute to use for sorting from attribute settings.

I come to know that there is some issue with sorting when the attribute type is "Yes/No".
Can you anyone help me to fix this issue and or let me know if i am doing anything wrong?

Thanks


texts: How can I remove the state (Bundesland) field completely in a German shop?

texts:
When using Market Ready Germany there was such an option. But we use German Setup.

Is there a clean and easy solution to remove this field fully from the system?


texts:
I try to add image in invoice it's working fine but i need to add after total

$image = Mage::getBaseDir('media') . '/bar.png';
if (is_file($image)) {
    $imageWidth = 812; $imageHeight = 450;
    $image = Zend_Pdf_Image::imageWithPath($image,$imageWidth,$imageHeight);
    $y=$imageHeight /2.5;
    $page->drawImage($image, 35,$y, 35+ $imageWidth / 1.5, $y + $imageHeight/2);

}

also I created Dynamic Image Based on Order id then how to get that name

$custom = $invoice->getIncrementId();

        $image = Mage::getBaseDir('media') . '/.'$custom'.png';
if (is_file($image)) {
    $imageWidth = 812; $imageHeight = 450;
    $image = Zend_Pdf_Image::imageWithPath($image,$imageWidth,$imageHeight);
    $y=$imageHeight /2.5;
    $page->drawImage($image, 35,$y, 35+ $imageWidth / 1.5, $y + $imageHeight/2);

}

How to add this after total what mistake i done here?


texts: Get configurable products associated with simple products

texts:
I have to show the configurable products associated with simple products.

I have to show these configurable products in grid in product edit page in admin section, same as related products sections comes.

I am able to add that grid to list the products but hoe to achieve the other data like name and sku as i am trying to collect data from catalog_product_super_link table.


texts: Token based authentication for customer in magento1.x

texts: How to implement token based authentication in magento1.x for customer similar to Magento2. For example rest api as {base}/rest/V1/integration/customer/token ?


texts: i want product page sidebar as related products instant of upsell products

texts:
here is my catalog.xml block:

 <block type="catalog/product_list_upsell" name="product.info.upsell" as="upsell_products" template="catalog/product/list/upsell.phtml" />

here is my view.xml

<?php echo $this->getChildHtml('upsell_products') ?>


texts: Magento2.3.1 i want to remove wishlist link from top.links but not working

texts:
I have added  below code in my custom Magento_Theme default.xml file to remove top.links

  <referenceBlock name="top.links">
     <referenceBlock name="register-link" remove="true"/>
      <!--for Create Account Link-->
      <referenceBlock name="wish-list-link" remove="true"/>
      <!--for WishList Link-->
      <referenceBlock name="my-account-link" remove="true"/>
      <!--for My Account Link-->
  </referenceBlock>

all other links removed but wishlist not remove


texts:
When I use expression

*/1 * * * *   // Every minute

it works fine. But when I use

* */24 * * *  // Every 24 hours

or

0 0 * * *    // Midnight

or

30 9 * * *  // 9:30 AM

it does not work. Could you please explain what I am doing wrong.
My purpose is to run cron every day at specific time. Thanks.

EDIT

I have created a custom module Customer_Feedback. In its config.xml I have added

<crontab>
    <jobs>
        <customer_feedback_send>
            <schedule><cron_expr>0 12 * * *</cron_expr></schedule>
            <run><model>feedback/observer::sendEmail</model></run>
        </customer_feedback_send>
    </jobs>
</crontab>

But I can't see any entry for job code customer_feedback_send in cron schedule table.
However this method works fine when I use

 <schedule><cron_expr>*/1 * * * *</cron_expr></schedule>


texts: Magento 2 Invalid Block Type in Custom Module?

texts:
How can I Rectify Invalid Block Type Error in my custom module.

I created a custom module in magento 2 for overriding default product list page with separate phtml file I am calling them in category update layout xml textarea. It's Working fine.

Now I don't want that so I deleted Layout Update xml textarea code and both my custom module block and phtml. After running setup upgrade and cleared var/all folders and pub/static/all folders . Still I am getting Invalid Block Type error.

Do I need to delete anything from any tables.


texts: How to get country of origin of the store from configuration

texts:
I need to programmatically get the country, zip code and state of the store that is at:
Stores->Configuration->SALES->Shipping Settings->Origin


texts: Save Form Data in UI Component form Not Working

texts:
This is My save Button

 use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;

 class SaveButton extends GenericButton implements ButtonProviderInterface
{
public function getButtonData()
{
    return [
        'label' => __('Save Contact'),
        'class' => 'save primary',
        'data_attribute' => [
            'mage-init' => ['button' => ['event' => 'save']],
            'form-role' => 'save',
        ],
        //'on_click' => sprintf("location.href= '%s';", $this->getSaveUrl()),
        'sort_order' => 90
    ];
}

public function getSaveUrl()
{
    return $this->getUrl('*/*/save', [])
;
}
}

This is My controller

 <?php
 namespace My\Module\Controller\Adminhtml\Test;

 class Save extends \Magento\Backend\App\Action
 {
protected $resultPageFactory;
protected $saveFactory;

public function __construct(
    \Magento\Backend\App\Action\Context $context,
    \Magento\Framework\View\Result\PageFactory $resultPageFactory,
    \My\Module\Model\SaveFactory $saveFactory
)
{
    $this->resultPageFactory = $resultPageFactory;
    $this->saveFactory = $saveFactory;
    parent::__construct($context);
}

public function execute()
{
    $resultRedirect = $this->resultRedirectFactory->create();
    $data = $this->getRequest()->getPostValue();

    if($data)
    {
        try{
            $id = $data['id'];

            $contact = $this->saveFactory->create()->load($id);

            $data = array_filter($data, function($value) {return $value !== ''; });

            $contact->setData($data);
            $contact->save();
            $this->messageManager->addSuccess(__('Successfully saved the item.'));
            $this->_objectManager->get('Magento\Backend\Model\Session')->setFormData(false);
            return $resultRedirect->setPath('*/*/');
        }
        catch(\Exception $d)
        {
            $this->messageManager->addError($e->getMessage());
            $this->_objectManager->get('Magento\Backend\Model\Session')->setFormData($data);
            return $resultRedirect->setPath('*/*/edit', ['id' => $contact->getId()]);
        }
    }

     return $resultRedirect->setPath('*/*/');
}
}


texts: Can I print the invoice without sending the customer an email?

texts: I want to print some invoices but my customer shouldn't receive an email.


texts: Add Js code for Google measuing checkout in checkout

texts:
I want to measure checkout page using tag manager
Enhanced Ecommerce.

I refered https://developers.google.com/tag-manager/enhanced-ecommerce#checkout.

How to add this script.

Thanks.


texts: "clear shopping cart" and "continue shopping" buttons are not coming in checkout page in magento 2.3

texts:
I want to display "clear shopping cart" and "continue shopping" buttons on my checkout page. But i dont see configurations for the same.
i checked the /srv/public_html/vendor/magento/module-checkout/view/frontend/templates/cart/form.phtml and in this buttons are der . But i dont know how to configure them.
plz help


texts: DOB Validation with three fields in magento2

texts:
I need to change the "date of birth" field from date picker to three fields with validation.

How to do it?


texts:
Been following a tutorial but it installs dev version of Magento2. How can I install the stable version 2.1.x ?

cd /var/ww/html/

git clone https://github.com/magento/magento2.git

cd magento2

composer install


texts: Magento 2.1.5 Create Redirect in js method rendrer

texts:
How to create a js redirect which will trigger the controller to redirect to a payment gateway

I am tring to create a payment gateway for magento 2.1.5 which will be redirected on the Bank

EDIT1 No Success:
After your reply I have implemented this in the model but there is not redirection happening

    namespace Vendor\CustomPayment\Model\Payment;

    class CustomPayment extends \Magento\Payment\Model\Method\AbstractMethod
    {

        protected $_code = "CustomPayment";
        protected $_isOffline = true;

        public function isAvailable(
            \Magento\Quote\Api\Data\CartInterface $quote = null
        ) {
            return parent::isAvailable($quote);
        }

        public function getCheckoutRedirectUrl()
        {
            return 'http://CustomPayment.com';
        }
    }


texts: unable to Update product collection via observer in Magento2

texts:
I'm trying to update product collection (excluding some products, to be exact) through observer.
I'm using the event catalog_block_product_list_collection
Observer is catching the event fine.

in observer execute method:

    public function execute(\Magento\Framework\Event\Observer $observer) {
        $newCollection = $observer->getEvent()
            ->getCollection();
        $newCollection->addAttributeToFilter('entity_id', ['nin' => [1,2,13]]);
        return $this;
    }

but nothing happens.

I've also tried the event catalog_product_collection_load_after but the case is same.

How can i update this collection via observer?

edit: Using addFieldToFilter or addIdFilter results in "main.CRITICAL: illegal state" in log file system.log and no products shows up but overall page loads fine.


texts:
How to get storeview ID (view) by group_id (store) in Magento? Basically I want to list storeviews by their store_id.

Mage::app()->getStores() will get all storeviews, but I want to filter it by specific store group like

Mage::app()->getStores()->byGroupId($store_group_id);

so i can list all storeviews under a specific store.