texts: Is it officially reccomened to add a totally new phtml template file in a theme, one which doesn't override an existing template?

texts:
Magento's documentation (https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/templates/template-walkthrough.html#template-customization-walkthrough) describes how to customise an existing template, by overriding it in your theme - copying the phtml from a core module into your theme then modify it.
It seems possible to add a new phtml template with a custom theme, not override an existing template. This can be achieved by creating the new phtml template in the Vendor/Theme/Magento_Theme/templates/my_new_template.phtml, where my_new_template.phtml was not an existing template in Magento_Theme. Then to get that new template onto the page by using a layout file, referencing that new template and giving it a standard block, like this
<referenceContainer name="some.reference">
    <block class="Magento\Framework\View\Element\Template" name="my.new.template" template="Magento_Theme::my_new_template.phtml" />
</referenceContainer>

The key bit here is that my_new_template.phtml did not exist previously and is not being overridden. Its new.
Is this a Magento sanctioned method of adding a new template to a page from within a theme?
The [docs][1] I linked to at the start of this question do say

To add a new template in a theme:
Add a template in your theme directory according to the template storing convention.
Assign your template to a block in the corresponding layout file.

But there is no example and its unclear and I'm not sure I've interpreted this correctly.
Is this recommend by Magento?
[1]: https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/templates/template-walkthrough.html#template-customization-walkthrough)


texts:
I am using magento 1 and I am trying to set up my menu to have sub menus that are in columns, not one long list.
This is what css code I'm currently using is

.jewelry {
  float: left;
  width: 33.33%;
  padding: 100px;
}

/* Clear floats after the columns */
.row:after {
  display: table;
  clear: both;
}

which is in : httpdocs / skin / frontend / theme / default / css / homeDesign.css
and then I updated my layout.xml with

<action method="addItem"><type>skin_css</type><file>css/homeDesign.css</file></action>

and my html code in my block for the menu is:

Label

thing

   ...

thing

    ...

thing

    ...

But, when I update my site with this I get a jumbled mess. All the columns stack on top of each other. What should I do to fix this?


texts:
I am trying to upgrade Magento version of my site from Magento 1 to Magento 2. In this case I am using Migration Tool. I used below command

php bin/magento migrate:data /php/htdocs/magento2/vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.2.1/config.xml -vvv

I am getting following error message.

Actually I am learning this. I need a basic solution for this.

How can I get a error free result ??


texts: The current page formatting has been turn off. I checked the format is still present in the codes but not showing on the actual website. Please help.


texts: How to enable/disable my custom module via system configuration values in magento 2?

texts:
Is there a way I can disable my custom module according to the system config value? So that the user of my module can just disable the module from frontend by just setting it in admin configuration?

System.xml

    <?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="ccengine" translate="label" sortOrder="10">
        ccengine
    </tab>

        <class>separator-top</class>
        User Config
        <tab>ccengine</tab>
        <resource>Faes_CCEngine::ccengine_config</resource>
        <group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
            General Configuration
            <field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
                Module Enable
                <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
            </field>
            <field id="url" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
                URL
                <comment>URL given</comment>
            </field>
            <field id="token" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
                Token
                <comment>Token given</comment>
            </field>
            <field id="font_family" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
                Font Family
                 <source_model>Faes\CCEngine\Model\Config\Source\Font</source_model>
                <comment>Font Family on the frontend.</comment>
            </field>
            <field id="primary_color" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                Primary Color
                <comment><![CDATA[Primary color]]></comment>
                <frontend_model>Faes\CCEngine\Block\Color</frontend_model>
            </field>
            <field id="secondary_color" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                Secondary Color
                <comment><![CDATA[Secondary color]]></comment>
                <frontend_model>Faes\CCEngine\Block\Color</frontend_model>
            </field>
        </group>

</system>


texts: Why is Magento so difficult and what can i expect to work on as a Magento developer?

texts:
I saw one question/answer here, but it didn't solve my question.

Hi, I am software developer with 2 years of experience.

I worked on 1 project till now which was actually theme customisation project(theme was purchased by the client). When I started learning (in the last 3 months) , I didnt get solid idea of coding in Magento like I had in OOP Php, Cakephp, Codeigniter etc. Still i don't feel like I am solid developer in Magento.

My question is why is Magento difficult for a developer who hasn't worked on Zend framework ?

And 2nd one : What tasks can i expect be working on as a Magento Developer?

P.S. I asked the question on programmer.stackexchange(Here), but users with high repution told me to ask the question here, to get answer.

Thanks


texts: Magento 2.3 add chunk of javascript code to my Custom Theme (phtml file)

texts:
I need to implement a Few Functions of javascript and a jquery code in to a phtml file in my Custom Theme.
I have read about the different way of implementation but I am not sure which is the best way for my 3 little functions. The chunk of code is using jquery.

Putting the js code directly to the phtml file works but I guess it is not the recommended way.
how i can call a one phtml file for whole website jquery and javascript code.

Can anyone guide me? Thanks!


texts: Translating products: 1 and the same product in two different store views

texts:
we have a product that is sold in two separate store views.

Question: If I translate product X in storeview store1->english and also want it available in store2->english; do I then need to copy/duplicate the content? Or can we re-use the data from store1->english

Our structure

store: store1
storename: store1 -> domain1.com
storeview: store1 -> domain1.com -> french -> productA
storeview: store1 -> domain1.com -> english -> productA

store:store2
storename: store2 -> domain2.com
storeview: store2 -> domain2.com -> english -> productA

For storeview:-> english -> productA do we need to enter all attributes/description manually - or can we re-use what we used under storeview:-> english -> productA easily ...

Hope this is clear ;P thx


texts: Adding parent_id attribute value in model

texts:
I have created a module and EAV tables for that. Module's tables are very similar to customer_Address entity and i have defined Attribute AttrA, AttrB and AttrC for this table.

So table structure is very similar to as follows:

+------------------+----------------------+------+-----+---------------------+----------------+
| Field            | Type                 | Null | Key | Default             | Extra          |
+------------------+----------------------+------+-----+---------------------+----------------+
| entity_id        | int(10) unsigned     | NO   | PRI | NULL                | auto_increment |
| entity_type_id   | smallint(5) unsigned | NO   |     | 0                   |                |
| attribute_set_id | smallint(5) unsigned | NO   |     | 0                   |                |
| increment_id     | varchar(50)          | YES  |     | NULL                |                |
| parent_id        | int(10) unsigned     | YES  | MUL | NULL                |                |
| created_at       | timestamp            | NO   |     | 0000-00-00 00:00:00 |                |
| updated_at       | timestamp            | NO   |     | 0000-00-00 00:00:00 |                |
| is_active        | smallint(5) unsigned | NO   |     | 1                   |                |
+------------------+----------------------+------+-----+---------------------+----------------+

and AttrA, AttrB and AttrC values are stored in tables with respective data type.

Now using the basic syntax, I am able to add value of attributes AttrA, AttrB and AttrC. Which is:

$model = Mage::getModel('customer/address');
$model->setAttrA('ValA')->setAttrB('ValB')->setAttrC('ValC');

doing this correctly sets the values of AttrA, AttrB and AttrC but value of parent_id in customer_entity sets to NULL by default.

Here I want to be able to set the parent_id to some other value.

For this i tried suggestion given in different post using setParentId(<parent-id-value>). Which is not working in my case. Any idea how i can do this?


texts:
I'm getting this error :

Notice: Object of class Magento\Store\Model\Group\Interceptor could not be converted to int in /var/www/html/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php on line 3065

The responsible piece of code is somewhere in it
foreach ($stores as $store){
    $storeId = $store->getId();
    $storeCode = $store->getCode();
    if($this->isProStore($storeCode)){
        $storeGroupId = $store->getStoreGroupId();
        $group = $this->groupFactory->create();
        if($storeGroupId !== null){
            $group->load($storeGroupId);
            $group->setRootCategoryId($rootCategoryId);
            $group->save();
            $factoryStore = $this->storeFactory->create();
            $factoryStore->load($storeId);
            $factoryStore->setStoreGroupId($group);
            $factoryStore->save();

        }
    }
}


texts:
I am curious to know. In Magento2,

if a product has been ordered, then deleted, then it has been re-created with the same SKU, will it be considered as one and the same product, or a diifferent one?

Please, also answer for Configurable products with virtual variations.

Thanks!


texts: Some partial UK postcodes table rates are not being recognised

texts:
My first post here so greetings to all!

I have an issue with table rates not applying the correct delivery charge to certain partial UK postcodes. It seems to affect UK postcodes where both alpha and numeric characters are used.

For example, my rate for BT postcodes is:

GBR * BT 8.33 25

Which correctly applys a £25 surcharge to orders £10 or over for any postcode starting with BT (e.g. BT31 2NR)

However my rate for TR21 postcodes doesn't work:

GBR * TR21 8.33 13

I have 9 rates for alpha only postcodes that all work and 16 rates for alphanumeric postcodes, none of which work. If I change the alphanumeric to alpha it works (e.g. change TR21 to TR) so it does seem to be related to the alphanumeric nature of the postcode.

I need to use alphanumeric as my courier surcharges on certain areas - TR21 for example is the Scilly Isles - and the TR postcode covers all of southwest Cornwall where there is no surcharge, hence I only want TR21 to apply the surcharge.

Can anyone give me any advice on how to get alphanumeric UK postcodes to work on table rates?

Thanks!


texts: How to show the two grid in single page?

texts:
I am working vendor concept site.

Here I am using two types of products:

  My Uploaded Products (My Own Products).
  Assigned Products (Assign the Other vendor Products to my product).

In the admin-panel under catalog need to add one sub menu "My All Products" (I did this).

Once click this sub-menu, need to show the both my uploaded products and assign products in the tab view.

When I click my uploaded products tab to show all my uploaded products in that grid.

Then I click assign products tab to show all assign products in that grid.

How can i do this ?.

Please any one help me.


texts: After Upgrade 2.2.5 to 2.3.0 Getting Error:CMS_BLOCK_STORE_BLOCK_ID_CMS_BLOCK_BLOCK_ID' to system tables,

texts:
After Upgrade 2.2.5 To 2.3.0 when i am runnung php bin/magento setup:upgrade it give bellow error:

Schema creation/updates:

  SQLSTATE[HY000]: General error: 1823 Failed to add the foreign key constraint 'test@test@002dtestnew/CMS_BLOCK_STORE_BLOCK_ID_CMS_BLOCK_BLOCK_ID' to system tables, query was: ALTER TABLE cms_block_store MODIFY COLUMN block_id smallint(6)  NOT NULL   , ADD CONSTRAINT CMS_BLOCK_STORE_BLOCK_ID_CMS_BLOCK_BLOCK_ID FOREIGN KEY (block_id) REFERENCES cms_block (block_id)  ON DELETE CASCADE, ADD CONSTRAINT CMS_BLOCK_STORE_STORE_ID_STORE_STORE_ID FOREIGN KEY (store_id) REFERENCES store (store_id)  ON DELETE CASCADE


texts:
I have inserted a textarea in the checkout/cart page as shown in the image below.

I want to insert this data when proceeding to checkout is clicked or when clicking on the update shopping cart in quote_item table in a custom column order_item_note    that I created.
Thanks in advance.


texts: Products in Magento - SKUs from a category

texts:
Would you have any way to get product SKUs from a category? For example, I have a category with id = 13 and I need to get the SKUs of these products dynamically, so I can do checks that I created in my code.

And I would need to save these SKUs of these products in an array so I can do a check in my code, as I currently "pick up" these SKUs manually by placing them in an array.

Code created in a controller:

public function isCartaoAddAction(){
            $array_de_skus_de_cartoes = array(45,60,80,90,102,103,104,105); //SKUs products
            $isCartaoAdicionado = 0;
            $cart = Mage::getModel('checkout/cart')->getQuote();
            foreach ($cart->getAllItems() as $item) {
                foreach ($array_de_skus_de_cartoes as $sku) {
                    if($sku == $item->getProduct()->getSku()) {
                        $isCartaoAdicionado = 1;
                        $cartao_id = Mage::getModel("catalog/product")->getIdBySku($sku);
                    }
                }
            }
            if($isCartaoAdicionado == 1) {
                echo json_encode(array('adicionado' => '1','id_produto' => $cartao_id));
            } else {
                echo json_encode(array('adicionado' => '','id_produto' => ''));
            }
        }


texts: Magento 2 : ERROR: Call to a member function getOrder() on null

texts:
I am not sure what is the issue, but i get this error

ERROR: Call to a member function getOrder() on null in production site but not in local
(i am using same version Magento ver. 2.4.1)
I have override this file/class

Magento\CustomerBalance\Model\Balance.php

& in
protected function _ensureCustomer()
    {
        $order = $this->_coreRegistry->registry('current_creditmemo')->getOrder(); //error here
        $orderdata = $this->getOrder(); // also it gives error here
    }

At the same time it does not give me error in local environment.
I need your opinion on this,

how this can be debugged or solved ?
how to check what is the cause    of the error ?


texts: IE9 users being logged out when viewing a product

texts:
We have a problem on a Magento 1.9.0.1 store where if you use IE9 and log into your account then try to view a product this will somehow clear your session. It doesn't happen on any other page.

This problem seems similar to this question:

https://stackoverflow.com/questions/9285795/magento-checkout-redirects-to-shopping-cart-is-empty-page-and-clears-cart-in-i

I have tried the solution of modifying the cookie timeout, set it to a week (86400 seconds) and changed the path and domain of the cookie through the Magento backend.

I have also tried disabling any modules that may be running on the product page and we still have the same issue.

Any pointers or ideas on what may be causing the problem would be useful.


texts: Field dependency for category attributes

texts:
I add attributes in setup script, all is configured properly and attributes are added to a new tab called "MyGroup":

$installer = $this;
$installer->startSetup();
$installer->addAttribute('catalog_category', 'my_attribute1', array(
    'group'         => 'MyGroup',
    'input'         => 'text',
    'type'          => 'varchar',
    'label'         => 'My Attribute 1',
    'backend'       => '',
    'visible'       => 1,
    'required'      => 0,
    'user_defined' => 1,
    'global'        => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));
//...here add more attributes
$installer->endSetup();

This automatically creates a tab "MyGroup" and a form with fields for all the attributes which I defined in setup script.

Is there a way to have more control over the entire form inside "MyGroup" tab? For example, normally when I create an admin form I can also add dependency for fields (e.g. to hide field2 if no option selected in field1 etc.). I know how to add field dependency in custom admin form (e.g. http://www.atwix.com/magento/fields-dependency-in-magento-admin-forms/) but I don't know how to do this with category attributes.

So is there a way to override that form somehow? Or at least to add field dependency?


texts: How to get list of third party modules programatically?

texts:
By using this link i am able to get all extensions list in Magento 2. But i want to get only Third Party extensions which are installed in app/code directory.

For example, there are 3 modules in app/code directory, then i only want to get list of these 3 modules.


texts: How can I generate a full swagger doc for Magento 2 REST API?

texts:
I have a fresh Magento 2.1.5 install, and I'd like to access the full swagger spec, like the one published on http://devdocs.magento.com/swagger, but with the Try it Out! buttons enabled.

I've accessed my local swagger spec on http://localhost/magento2/swagger, but the services list isn't complete, when compared to the published on the Magento site.


texts:
I have the follow SQL that I want to execute from a custom module:

SELECT c2.value
FROM catalog_category_product c1
INNER JOIN catalog_category_entity_varchar c2 ON (c1.category_id = c2.entity_id)
INNER JOIN catalog_product_entity c3 ON (c1.product_id = c3.entity_id)
WHERE c2.attribute_id = (SELECT attribute_id FROM eav_attribute WHERE attribute_code = 'name' AND entity_type_id = 3)
AND c3.entity_id = PRODUCT_ID_HERE

I am new on this and, from what I read, I should be able to use collections and commands like getSelect(), but I can't figure out a way to "convert" my SQL query into this format.

How can I do that? Or where can I read more about it?

Thanks!

REAL EXAMPLE:

To be more clear, I need to modify an extension in order to bring product categories field in a specific report. Editing .phtml files I am able to do somethings like this:

$product_id = PRODUCT_ID_HERE;
$product = Mage::getModel('catalog/product')->load($product_id);
$cats = $product->getCategoryIds();

foreach ($cats as $category_id) {
   $_cat = Mage::getModel('catalog/category')->load($category_id);
   echo $_cat->getName();
}

But with that I am changing just the Frontend. The better solution would be to edit the extension Model to do something like what they already have:

$itemTable = Mage::helper('advancedreports/sql')->getTable('sales_flat_order_item');
$this->getSelect()
   ->join(
      array('item' => $itemTable),
      "(item.order_id = main_table.entity_id AND item.parent_item_id IS NULL)",
      array()
   );

But I can't figure out how to "convert" my SQL query into this Model format...


texts: No payment Method available on checkout screen

texts: Senario is :If customer is from Pakistan, then  theShipping method (Flat)  and the Payment method -Cash On Delivery will be shown . Now the issue is, I have done with all the settings as per the scenario but its still showing no Payment method available on checkout ![enter image description here][![enter image description here]2]23


texts: How do I get dynamically updated price after selecting an option with additional value?

texts:
After selecting a attributo or super-attributo which are of options of product that may have an additional value or not, if you have additional value the price is changed automatically.

I need get the price updated after every modification of the original price.

Can someone give me a solution?


texts: How do I get a methods argument for an after plugin in Magento 2?

texts:
Is it possible to access an observed methods arguments in an after[Method]() plugin? For example, I want to write an after plug in for:

namespace Magento\Some_Core\Model\Example;
class Test {
  public function usualMethod(\Magento\Sales\Model\Order $order) {
    // get order information and attach to $this
    return $this;
  }
}

I have my Custom Module's di.xml set up and my plug in class as:

namespace Vendor\Module\Plugin\Example;
class TestPlugin {
  public function afterUsualMethod(\Magento\Some_Core\Model\Example\Test $subject, $return) {
    $order = $subject->getArguments(0); // ??
    $result->setAdditionalOrderInfo($order->getIAlsoNeedThis());
    return $result;
 }
}

Is there any way to access the $order object passed in the original method? I can easily extend the original class and call parent::usualMethod() but wanted to know if it was possible to use a plugin for this scenario.


texts: I have error Call to a member function getData() on null l/vendor/magento/module-catalog/Helper/Image.php:501 in supro theme

texts:
I have error main.CRITICAL: Error: Call to a member function getData() on null in /home/bigroadusa/web/bigroadusa.com/public_html/vendor/magento/module-catalog/Helper/Image.php:501 in debug and system log. This error show when i go to vendor products page.
Exception log empty.
Screenshot vendor products page

link leads to first product


texts: Iam using magento porto theme and issue is i cant be able to change price by clicking configurable products

texts:
This is my working place and problem in Price change price is not changing in main changing in sticky option.

i couldn't find any solution, please help me..

http://vinyl.solutions/index.php/4-x-4/4-x-4-camo-greyscale-decal.html


texts: Override class not working on linux server in magento2?

texts:
I want to override Magento\ImportExport\Model\Import\Adapter class
 i have set in di.xml

 <?xml version="1.0"?>
   <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
   <preference for="Magento\ImportExport\Model\Import\Adapter" type="Namespace\DownloadableImport\Model\Import\Adapter" />
   </config>

and my Namespace\DownloadableImport\Model\Import\Adapter code is:

<?php

 namespace Namespace\DownloadableImport\Model\Import;

  use Magento\Framework\Filesystem\Directory\Write;

 class Adapter extends \Magento\ImportExport\Model\Import\Adapter
{
/**
 * Adapter factory. Checks for availability, loads and create instance of import adapter object.
 *
 * @param string $type Adapter type ('csv', 'xml' etc.)
 * @param Write $directory
 * @param string $source
 * @param mixed $options OPTIONAL Adapter constructor options
 *
 * @return AbstractSource
 *
 * @throws \Magento\Framework\Exception\LocalizedException
 */
public static function factory($type, $directory, $source, $options = null)
{
    if (!is_string($type) || !$type) {
        throw new \Magento\Framework\Exception\LocalizedException(
            __('The adapter type must be a non-empty string.')
        );
    }
   // $adapterClass = 'Magento\ImportExport\Model\Import\Source\\' . ucfirst(strtolower($type));
    $adapterClass = 'Tatva\DownloadableImport\Model\Import\Source\\' . ucfirst(strtolower($type));

    if (!class_exists($adapterClass)) {
        throw new \Magento\Framework\Exception\LocalizedException(
            __('\'%1\' file extension is not supported', $type)
        );
    }
    $adapter = new $adapterClass($source, $directory, $options);

    if (!$adapter instanceof AbstractSource) {
        throw new \Magento\Framework\Exception\LocalizedException(
            __('Adapter must be an instance of \Magento\ImportExport\Model\Import\AbstractSource')
        );
    }
    return $adapter;
}

/**
 * Create adapter instance for specified source file.
 *
 * @param string $source Source file path.
 * @param Write $directory
 * @param mixed $options OPTIONAL Adapter constructor options
 *
 * @return AbstractSource
 */
public static function findAdapterFor($source, $directory, $options = null)
{
    return self::factory(pathinfo($source, PATHINFO_EXTENSION), $directory, $source, $options);
}
}

it's working on xampp server but not linux server.

I have flushed cache and setup upgrade and di compile command already run but still not working


texts:
In my site I have set a filter for ordering my products by attribute, but the order is alphabetical and I would like the order to be by position attribute setted in backend.

Example attribute color:

Valuename   |   Position

green  |       1

blue        |       2

red   |       3

The actual result in frontend is product blue then green then red,
I would like the result is green then blue then red

What classes should I modify for resolving this problem?


texts: Magento 2 custom module set the css and js file using the check the particular product attribute is enable or not

texts:
I have a custom module.I want to the add the css and js file if my custom product attribute value is available.

In xml I can't check product attribute value is available or not.

so what i do?

Please provide me the best solution.


texts: getFullActionName() returns empty results for product pages inside predispatch observer

texts:
I have created an observer listening to the event controller_action_predispatch on a clean Magento 2.4.2 instance, and I tried to get the module name and full action name from within the observer. It worked well for all pages except the product pages.
For example, for the registration page:
$observer->getEvent()->getRequest()->getModuleName() // it gives "customer"
$observer->getEvent()->getRequest()->getFullActionName() // it gives "customer_account_create"

and for shopping cart page:
$observer->getEvent()->getRequest()->getModuleName() // it gives "checkout"
$observer->getEvent()->getRequest()->getFullActionName() // it gives "checkout_cart_index"

but when I tried to capture the above info for the product pages
$observer->getEvent()->getRequest()->getModuleName() // it gives ""
$observer->getEvent()->getRequest()->getFullActionName() // it gives "__" (2 underscores)


texts: How to check reindex triggers from Magento 2.4 database?

texts:
I would like to check my database triggers related to stock updates in my Magento 2.4.
I need to know what are the triggers to stock updates specifically.
How could I check it?


texts: Gatling load testing strategy for going through checkout with form key?

texts:
I am interested in doing some Gatling performance testing but am a bit unsure of how to do this considering Magento's use of form keys to prevent CSRF. I know there are a number of people out there who have used Gatling for load testing but in my own brief testing and with my understanding of Magento's forms, a valid form key needs to be provided for many requests. Checkout is a great example, but I believe in 1.8 and 1.13 add to cart URLs are also protected with a form key.

Is there a way to create orders and simulate a checkout process using Gatling with Magento's form keys? If not, is there a "standard" or easy way of disabling form keys on the frontend?

I know that testing EE 1.13 with Gatling is certainly possible, this Magento knowledge base article talks about Gatling + EE 1.13 (http://www.magentocommerce.com/knowledge-base/entry/ee113-performance-and-scalability-white-paper).  They are placing orders as well, but again it's unclear to me as to how they are actually doing this.

Any information on how Gatling might be used to test adding products to cart, checkout, etc, would be incredibly helpful.


texts: Get recently ordered products by date in account dashboard page?

texts:
<?php $orders = $this->getOrders(); ?>

<?php echo $this->__('Recent Orders'); ?>

        <?php if (sizeof($orders->getItems()) > 0): ?>
            <a class="button button--s" href="<?php echo $this->getUrl('sales/order/history'); ?>"><?php echo $this->__('View All'); ?>
        <?php endif; ?>

    <?php if ( sizeof($orders->getItems()) > 0 ): ?>

                            <?php echo $this->__('Date'); ?>
                            <?php echo $this->__('Status'); ?>
                            <?php echo $this->__('Total'); ?>
                            <?php echo $this->__('Order #'); ?>

                        <?php foreach ($orders as $order): ?>

                                <?php echo $this->formatDate($order->getCreatedAtStoreDate(), 'medium'); ?>
                                <?php echo $order->getStatusLabel(); ?>
                                <?php echo $order->formatPrice($order->getGrandTotal()); ?>

                                  <a href="<?php echo $this->getViewUrl($order); ?>"><?php echo $order->getRealOrderId(); ?> - View
                                  Track Package

                        <?php endforeach; ?>

Currently I am getting order details by date, but I also need products with name,size,color, price,image inside the table . How can I get this?


texts: Magento - Change the Scope of an Attribute

texts:
How can I change the scope of anattribute from 'Global' to 'Website'.

Is there an extension to change it or do I have to change it manually?


texts: When I deselect the swatch once after selected, the product image is not displaying in magento 2

texts: When I deselect the swatch once after selected the product image went blank when I inspected and the image src went undefined in Magento 2.2??


texts:
I need help to add "Buy Now" button on the product detail page and on product list page.It not the same as "Add to cart" button, "Buy now" button should show popup which asked only phone number, it should sent to controller product_id and selected attributes and save to db.

In Instant Purchases it works in another way. Customer should be log in and fill shipment and payment info. In my case I need that even guest may buy in one click without filling shipment and payment info, just phone and that't it. Another words I should make an order programatically.


texts: M2 | Field Validation is not working with dynamic rows in system configuration

texts:
I have applied filed validation in system.xml file it is working for other fields but not applying on Dynamic fields.

Here is my Dynamic Field:

            <field id="add_item" translate="label" sortOrder="15" showInDefault="0" showInWebsite="1" showInStore="0">
                <label>Set Dropdown Prices</label>
                <frontend_model>Vendor\Module\Block\Adminhtml\Menu\Field\AdditionalItem</frontend_model>
                <backend_model>Vendor\Module\Block\Adminhtml\Menu\Config\Backend\AdditionalItem</backend_model>
                <validate>validate-digits</validate>
            </field>

Update

Here is my column in Frontend Model:

$this->addColumn(
        'productcost',
        [
            'label' => __('Voucher Cost'),
            'size' => '150px',
            'class' => 'required-entry'
        ]
    );


texts:
I'm getting this error during composer install.
Does anyone know where or how to fix this issue?
[Composer\Downloader\TransportException]
  The "https://repo.magento.com/archives/ingenico/library-ops-m2/ingenico-library-ops-m2-3.5.0.0.zip" file could not be downloaded (HTTP/1.1 404 Not Found)


texts: Magento 2, how to do update of table data via controller in

texts:
i'm inserting some value into DB with a help of my controller:

public function execute()
{
    $markinfo = $this->_objectManager->create('Repka\Feedback\Model\Mark');
    $markinfo->setField_id  ($_POST["id"]);
    $markinfo->save();
    //new code here
}

and after that insert (instead //new code here), i want to update another table. How can i do that?
In block i did that like this:

public function upgrade_tcap() {
    $this->setup->startSetup();
    $this->setup->getConnection()->update
    (
        $this->setup->getTable('table_test'),
        ['label' => 'some_new_caption],
        $this->setup->getConnection()->quoteInto('id = ?', 1)
    );
    $this->setup->endSetup();
}

and in block __construct

protected $setup;
__construct(
ModuleDataSetupInterface $setup,  ....
) {
$this->setup = $setup;  ....
}

but i need to do that in controller


texts: Add enabled and/or effectivity to widgets

texts:
I'm trying to extend the magento widget insertion functionality (under CMS menu). specifically i'd like to add 'Enabled' and also an Active From/To.

I can do this on the admin interface in the normal way, however i can't seem to track down how the layout updates are loaded. ideally i'd like to be able to intercept the point where it gets the list of widgets from the db\collection and apply some conditional logic to ignore widgets that aren't yet active. I know if i get this working that caching could make it unreliable, but that's less of a concern.

If anyone could point me in the right direction, i'd appreciate it.

Thanks in advance.


texts: test for existence of column before calling collection->setOrder

texts:
I have seen that we can add one line to the magento core code that will add a secondary sort to product listings, like so:

/magento-catalog/Block/Product/ProductList/Toolbar.php
~line 192

if ($this->getCurrentOrder()) {
    $this->_collection->setOrder($this->getCurrentOrder(), $this->getCurrentDirection());
    $this->_collection->setOrder('name','asc');
    //^^^^^ this is my added line ^^^^^^^
}

Despite the fact that it is a no-no to alter to core magento code, this works just great.  Until I added an extension which steals the product toolbar from magento-catalog as a control for its own grid.  Since there is no 'name' column in that select, magento crashes on my ill-advised line.

Is there a way I can test to see if name is valid before I call setOrder?  If I can figure something out, maybe I'll move my code off to a plugin/extension.


texts: Why would my site be redirecting to /downloader/?

texts:
I'm working on a local development server using MAMP, and it's version controlled using .git & Tower. I went to begin working on a new feature, and did a fresh pull from our master branch as per usual. Now when I navigate to any page, I'm redirected to /downloader/. I did my research before posting the topic, and here's what I've checked so far:

local.xml settings all point to the appropriate dB & user settings
local.xml and Mage.php exist and are set to 644 permissions
var/cache & car/session directories have been cleared

Any other ideas of what I should be looking for to resolve this?


texts:
How can I disable the messages that appear on the top of the page. For example:

The code of the message is this one:

        Please wait for your account to be activated

        Obrigado por se registar com Menu.

Thanks a lot,

Rafael


texts: Can I redirect people to the correct store view based on IP?

texts:
I am using GEOIP to redirect customers to either the US site or the UK site, but recently the client wanted to have the flags at the top of the site for the customers to manually switch to the US or UK site if they get on the wrong site.

But having an issue, I can only get the store flags if I put both the US and UK store views in the same store name, see pic

If I was to give US site its own store name with its own store view the flags would disappear.

I've seen several GEOip magento plugins some on github some on the magento connect store but if anyone knows of any that will allows me to redirect people to the specific store view name based on IP location.

Any ideas would be greatly appreciated.


texts: Magento2 : How To Get First Table Column From Join Query Result(From Duplicate Columns)

texts:
Table1 - col_name col_city col_tid

Table 2 - col_id col_city

In Magento2 i want  col_name,col_city from Table1 And col_id from Table2 Using Join Query
And col_city is in both table so i just want col_city from Table1.

i already tried with below join query

    $this->setMainTable('Table1');

    $this->getSelect()
         ->joinLeft(
                array('tbl2' => $this->getTable('Table2')),
                'main_table.col_tid = tbl2.col_id'
         )

but it returns both tables  col_city column , so i just want col_city only from  Table1

so please tell me how i can do this in Magento2


texts: Command "show" failed: GitHub API limit (0 calls/hr) is exhausted

texts: does anyone know why I'm getting this error whenever I try t use the web setup wizard? I  get it upon viewing that page for the first time.


texts: Magento 2.2.3 API retuning HTML code while integration between Magento 2.2.3 & Linnworks

texts:
Request send

POST http://exhaustkings.co.uk/backup/rest/V1/integration/admin/token HTTP/1.1
Accept: application/json
User-Agent: Linnworks client
Content-Type: application/json
Content-Length: 48
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
Host: exhaustkings.co.uk

{"username":"[username]","password":"[password]"}

Response we receive:

HTTP/1.1 404 Not Found
Cache-Control: private, no-cache, no-store, must-revalidate, max-age=0
Pragma: no-cache
Content-Type: text/html
Content-Length: 1148
Date: Wed, 02 May 2018 14:36:23 GMT
Accept-Ranges: bytes
Server: LiteSpeed
Connection: Keep-Alive

<!DOCTYPE html>

<title> 404 Not Found
</title>

404

Not Found

The resource requested could not be found on this server!

Proudly powered by  LiteSpeed Web Server
Please be advised that LiteSpeed Technologies Inc. is not a web hosting company and, as such, has no control over content found on this site.

And I cannot find no "rest" folder anywhere under my Magento directory.


texts: Magento not upgrading from 1.9.2.4 to 1.9.3.1

texts:
I created a copy of my site on xammp as a Development version to test the upgrade from 1.9.2.4 to 1.9.3.1 . But when I went forth and carried out the upgrade, I got no errors although going to magento connect my version shows 1.9.2.4. Looking at core_resources table the data_version numbers match 1.9.2.4. So looks like a failed upgrade.

I used the method of replacing the app > core folder with the new one. And the frontend base default folder, Then mage.php file with new one. From here I deleted local.xml and went through installation. Could you guys help with what is the best way to upgrade and where did I go wrong?


texts: How to get product attribute without using Object manager?

texts: How to get product attribute of a product without using Object manager directly, since using Object manager is not recommended?


texts:
In my Magento 2.3.3 instance If I disable EVENT:sales_quote_item_qty_set_after , Observer: inventory then "/checkout/cart/" and "/checkout/" speeds up but it also remove ability to validated minimum quantity per product in a cart.

I have observered as the number of products increase in cart , "inventory" observe is taking longer and slowing overall mangento site.

It there any option to still maintain "minimum qty per product in a cart" while improve site performance.
Or Is there option to improve perfromance of QuantityValidator Observer

  Validator :
  Magento\CatalogInventory\Observer\QuantityValidatorObserver EVENT :
  sales_quote_item_qty_set_after  OBSERVER : inventory


texts: Customer Cannot Login After an Update to EE 1.13.1.0 (or CE 1.8.1.0)

texts: I updated to the most recent Enterprise version and can not login anymore. Posting the login form just brings me back to this form.


texts: How to add a link in a grid column if the records are not found

texts:
I created a custom module.In grid if data is available then in action column edit option is there. If there is no data, then no edit option is displayed. So, I cannot enter into edit page if no data is available.
I cant use add new entry button. My requirement is to get the link in a grid column. I tried using a renderer but no luck.

namespace Vendor\Module\Block\Adminhtml\Data\Grid\Renderer;
class Link extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer
{
public function render(\Magento\Framework\DataObject $row)
{
    $category = $row->getDataAllowed();
    if (empty($category))
    {
        $value =  $row->getData($this->getColumn()->getIndex());
        return 'New'.$value.'';
    }
}
}

and in customgrid.php I mention renderer also.

  $this->addColumn('action', array(
        'header' => __('Action'),
        'width' => '100',
        'type' => 'action',
        'getter' => 'getId',
        'renderer' => 'Vendor\Module\Block\Adminhtml\Data\Grid\Renderer\Link',
        'actions' => array(
            array(
                'caption' => __('Edit'),
                'url' => array('base' => 'vendor_module/Data/edit'),
                'field' => 'id'
            )
        ),
        'filter' => false,
        'sortable' => false,
        'index' => 'stores',
        'is_system' => true,
    ));

The output should come like this


texts: call to a member function addAttributeToFilter() and addCategoryFilter() on null after upgrading Magento 2.3.3

texts:
After upgrading to Magento 2.3.3 below filters are not working.

  protected function _getProductCollection() {
                return $this->getProducts();
            }

            public function getProducts() {
        $count = $this->getProductCount();
         $category_id = $this->getData("category_id");
    $collection = clone $this->_collection;
    //$collection = clone $this->_collection;
    $collection->clear()->getSelect()->reset(Select::WHERE)->reset(Select::ORDER)->reset(Select::LIMIT_COUNT)->reset(Select::LIMIT_OFFSET)->reset(Select::GROUP);

    if(!$category_id) {
        $category_id = $this->_storeManager->getStore()->getRootCategoryId();
    }
    $category = $this->categoryFactory->create()->load($category_id);
         $collection->addMinimalPrice()
                            ->addFinalPrice()
                            ->addTaxPercents()
                            ->addAttributeToSelect('name')
                            ->addAttributeToSelect('image')
                            ->addAttributeToSelect('small_image')
                            ->addAttributeToSelect('thumbnail')
                            ->addAttributeToSelect($this->_catalogConfig->getProductAttributes())
                            ->addUrlRewrite()
    ->addAttributeToFilter('sw_featured', [1], 'left')
                            ->addCategoryFilter($category);
        }
 $collection->getSelect()
            ->order('rand()')
            ->limit($count);

        return $collection;
        }

The above code is worked Magento 2.1.x, but after upgrading it's not working.

Please suggest to us.


texts:
Hey so I've been wrestling with this one for a bit now. I have our store pretty much setup and am in the performance testing phase trying to get the site as speedy as possible.

I'm using Magento's built-in cache in conjunction with a cache warmer to ensure that the pages will render as soon as possible but the problem is that the cache seems to clear way too quickly. If I hit a link and refresh it immediately the page returns very quickly ~1s, but if I wait 5 minutes and then refresh the page is back to taking ~5s to respond.

I'm assuming this is due to the cache either being invalidated or just not used. I've checked the obvious stuff in the admin like the TTL is set to 86400 and the caches are enabled.

I'm not quite sure what would being causing this, any suggestions on what to check would be appreciated!

EDIT: So I enabled developer mode and took a look at the X-Magento-Cache-Debug header and it is reporting HIT for the pages when they load quickly (immediate refresh) and when they load slowly(refresh 5 min later). From this I guess I was wrong that it was the cache being cleared as it seems to be hitting the cache. Any ideas on what would be causing the slowdown?


texts: When do I have to use load() on collection

texts: I can meet many different approaches when using collections in Magento 2. Rarely, but sometimes I see that functions load() is used. Although without it there is no problem with accessing collection or its items. So what is the purpose of using it and do we really need load() collection in some situations?


texts: Using Magento Enterprise post-SLA : not benefiting from support or updates

texts: After years with a fully paid EE subscription, is it possible to stick with our current (older) EE code base and discontinue software updates and support? Updating to newer versions of EE breaks our main modules and EE technical support doesn't support the scope of our technical problems.


texts:
When I define a subcategory (i.e. sub1) in a category (i.e. main1), the resulting top menu displays:

The title of the category (main1)
The submenu with 2 option
View all main1
sub1

Why the View all text gets appended with category name ? How to disable it?

Also I am using custom package and made rwd/default as parent theme in theme.xml. Do we need to copy css and js too form skin folder too ?


texts: Magento 2 How to duplicate the category with same structure?

texts:
I want to duplicate the category with the same structure and data.

How to duplicate child categories here? It is working correctly for a single category.

In my controller file, I have the parent category id and category id which needs to duplicate. Now how can I create duplication of a category?

Please check my code is as below:

class DuplicateCategory extends \Magento\Backend\App\Action {
protected $_categoryFactory;
public function __construct(
\Magento\Backend\App\Action\Context $context,
\Magento\Catalog\Model\CategoryFactory $categoryFactory
) {
parent::__construct($context);
$this->_categoryFactory = $categoryFactory;
}

$parentCategoryObj = $this->_categoryFactory->create()->load(2);
$duplicateCategoryObj = $this->_categoryFactory->create()->load(8);
$catagoryObject = $this->_categoryFactory->create();

$categoryName = $duplicateCategoryObj->getName();
$categoryUrlKey = strtolower($this->getCategoryUrlKey($categoryName));

$catagoryObject->setPath($parentCategoryObj->getPath())
->setParentId($parentCategory)
->setName($duplicateCategoryObj->getName())
->setUrlKey($categoryUrlKey)
->setStoreId($storeId)
->setIsActive(true);
$catagoryObject->save();
}


texts: Add products via REST API to Magento 2 webshop

texts:
I want to add products to my webshop via a REST API.

I have the following API documentation available.

Ofcourse, I also have a API token and Test API token.

My question is, how can I import the product data to my Magento 2 webshop via the REST API? How can I connect to right fields with each other? Hopefully someone can help me or give me a direction.

Thanks! :-)


texts: Fatal error when try to create a user role

texts:
When I try to create a new user role from admin , it is throwing an error

Fatal error: Class 'Mage_Amlocator_Helper_Data' not found in /var/www/vhosts/stand-out.net/httpdocs/app/Mage.php on line 547


texts: Display shipping with inc and ex vat value on checkout

texts:
How to display shipping charge inc and ex tax on the checkout.
For example
3.25 [ex. VAT] 3.99 [inc. VAT]

on panel where you choose shipping method.
Cant see obvious configuration so assume template override?


texts: Why does getSize() does not match cart collection size?

texts:
Question popped up here: Filter collection on checkout/cart

Why does a filtered $collection->getSize() returns correct value, but iterating over collection has more items?

three items are in cart
want to filter one by SKU
result should be only one item

Example code:

$items = Mage::getSingleton('checkout/cart')->getQuote()->getItemsCollection();
$items->addFieldToFilter('sku', 75782007);

Using var_dump($items->getSize()) correctly returns int 1, but ...

foreach ($items as $item) {
    var_dump($item->getSku());
}

... results in ... (why?)

string '75782007' (length=8)
string '32811969' (length=8)
string 'hdd006' (length=6)

Workaround:

$itemIds = $items->getAllIds();
foreach ($items as $item) {
    if (in_array($item->getId(), $itemIds)) {
        var_dump($item->getSku());
    }
}

... results in ...

string '75782007' (length=8)

Why is getSize() and getAllIds() correct, but does not fit to collection count?


texts: Integrity constraint error while adding product to cart

texts: {"code":500,"result":"SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (magento.sales_flat_quote_item_option, CONSTRAINT qq_*********************** FOREIGN KEY (item_id) REFERENCES sales_flat_quote_item (item_id) ON DELETE CASCADE ON UPDATE CA), query was: INSERT INTO sales_flat_quote_item_option (product_id, code, value) VALUES (?, ?, ?)"}


texts: create an action anytime an order is canceled

texts:
For instance, i'm trying to send an API call when an order is cancelled.

Shouldn't this work?

 /**
     * Cancel order
     */
    public function cancelAction()
    {
        if ($order = $this->_initOrder()) {
            try {
                $order->cancel()
                    ->save();
                $this->_getSession()->addSuccess(
                    $this->__('The order has been cancelled.')
                );

                        // API Code Start
    $data = array(
    'partner_conversion_id' =>  $order->getIncrementId(),
    'event_status' => 'decline'
    );
$data_string = json_encode($data);
$ch = curl_init('https://api.e.com/v3/events/approve?partner_conversion_id='.$order->getIncrementId().'&event_status=decline');
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
    curl_setopt($ch, CURLOPT_USERPWD, "4-1:142d244");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'Content-Length: ' . strlen($data_string))
    );
    $result = curl_exec($ch);
    $result = ($result);
                // API Code End

            }
            catch (Mage_Core_Exception $e) {
                $this->_getSession()->addError($e->getMessage());
            }
            catch (Exception $e) {
                $this->_getSession()->addError($this->__('The order has not been cancelled.'));
                Mage::logException($e);
            }
            $this->_redirect('*/sales_order/view', array('order_id' => $order->getId()));
        }
    }


texts: Magento 1.9.2. - Change format of summary in cart page

texts:
I would like to change the format of the totals in the summary on the shopping cart page, on the checkout page and also in the email for new order, on the customer's orders list, etc.

At the moment Magento offers this standard format to report the totals:

I would like to change the coin symbol position and insert him before the number and instead of the comma insert the point, like this:

How can I do?

Can I modify it in such a way that it applies in every situation every time it shows the numerical values of the order summary?


texts: Does recommend work with Both M1 and M2 after successful Data migration using data migration tool?

texts:
We are under developing Magento 2.3.3 website, still Magento 1.9 site live. After successful Data migration using data migration tool from m1 to m2.

Note :  Still m1 live upcoming 5 months as well as working with magento 2.3.3.
Is my workout recommend?


texts: Product Attribute vs Product Attribute Assigned

texts:
Shopping Cart Price Rules

Magento version: 1.14.2.0

What is the difference between Product Attribute and Product Attribute Assigned sections in Conditions tab when creating a rule?

Both contain same set of options to select from but what is the difference between the two.


texts: Other tax modules that are reputable besides AvaTax

texts:
Can you guys give me some ideas on what else is out there? I've searched through the market but it all seems pretty meager in terms of other avenues to go down.

AvaTax is really expensive. Currently, we are just uploading an excel file occasionally which is very easy but would like something automated.


texts: How to Change Order Status using Api in magento 2.3.5

texts: I want to develop new module for changing order status using Api in magento 2.3.5 so can anyone have idea then please share with me. I want to create order status and change it using Api.


texts: How to get block details based on observer element name in Magento 2.3.5

texts:
I had below code which was working fine on Magento 2.2 after upgrading to 2.3.5 event observer not working  as expected.

Events.xml

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="core_layout_render_element">
      <observer name="mycompany_delivery_date_add_to_order_view" instance="MyCompany\DeliveryDate\Observer\OrderShippingBlockObserver" />
    </event>
</config>

OrderShippingBlockObserver.php

if($observer->getElementName() == 'sales.order.info') {
   $orderShippingViewBlock = $observer->getLayout()->getBlock($observer->getElementName());
   $order = $orderShippingViewBlock->getOrder();
}

This used to be working before in Magento 2.2 now I don't see the observer element name as sales.order.info. the ultimate goal here is to modify the output of the block and render it again.

$deliveryDateBlock->setTemplate('MyCompany_DeliveryDate::order_info_shipping_info.phtml');
$html = $observer->getTransport()->getOutput() . $deliveryDateBlock->toHtml();
$observer->getTransport()->setOutput($html);


texts:
I want to extend Mage_Shipping_Model_Shipping so that I can iterate through the collected methods and unset all but the lowest price. I do not want to do this on the frontend (which would probably be easier).

I have tried to debug '$this' in collectRates() but I just do not know how to unset a rate. If anyone can help me with this - even a workaround - that would be helpful.

The collectRates is in app/code/core/Mage/Shipping/Model/Shipping.php:

/**
 * Retrieve all methods for supplied shipping data
 *
 * @todo make it ordered
 * @param Mage_Shipping_Model_Shipping_Method_Request $data
 * @return Mage_Shipping_Model_Shipping
 */
public function collectRates(Mage_Shipping_Model_Rate_Request $request)
{
    $storeId = $request->getStoreId();
    if (!$request->getOrig()) {
        $request
            ->setCountryId(Mage::getStoreConfig(self::XML_PATH_STORE_COUNTRY_ID, $request->getStore()))
            ->setRegionId(Mage::getStoreConfig(self::XML_PATH_STORE_REGION_ID, $request->getStore()))
            ->setCity(Mage::getStoreConfig(self::XML_PATH_STORE_CITY, $request->getStore()))
            ->setPostcode(Mage::getStoreConfig(self::XML_PATH_STORE_ZIP, $request->getStore()));
    }

    $limitCarrier = $request->getLimitCarrier();
    if (!$limitCarrier) {
        $carriers = Mage::getStoreConfig('carriers', $storeId);

        foreach ($carriers as $carrierCode => $carrierConfig) {
            $this->collectCarrierRates($carrierCode, $request);
        }
    } else {
        if (!is_array($limitCarrier)) {
            $limitCarrier = array($limitCarrier);
        }
        foreach ($limitCarrier as $carrierCode) {
            $carrierConfig = Mage::getStoreConfig('carriers/' . $carrierCode, $storeId);
            if (!$carrierConfig) {
                continue;
            }
            $this->collectCarrierRates($carrierCode, $request);
        }
    }

    return $this;
}


texts: Parent class method _construct() is overriden by class that extends it and has same method

texts:
I'm having some troubles with passing properties between related classes.

Let's say we have a parent class:

class Company_Interface_Model_Import_Product extends Mage_Core_Model_Abstract {

    public $_someVariableSetInProductClass = null;

    public function _construct()
    {
        $this->_someVariableSetInProductClass = 'test';
        parent::_construct();
    }
}

Everything is obvious here. We're initializing public property $_someVariableSetInProductClass and in the _construct method we're updating it's value from null to string 'test'.

This property can be accessed wherever in this class by calling

$this->_someVariableSetInProductClass

Now we have a child class that extends it's parent, and we want to access that property _someVariableSetInProductClass which's set in parent class _construct() method.

class Company_Interface_Model_Import_Product_Categories extends Company_Interface_Model_Import_Product {

   public function _construct()
   {
       parent::_construct();
   }

   public function testAction()
   {
      var_dump($this->_someVariableSetInProductClass) //returns null
      var_dump(Mage::getModel('company_interface/import_product')->_someVariableSetInProductClass); //returns 'test';
   }
}

As far as I'm aware this would work in typical PHP setup, but Magento uses it's own constructor and somehow the only way to receive the property value from parent class is to call the class instance again.

This is strange for me cause everywhere we're prompted to avoid calling new instances and use the one existing.

UPDATE

If I do something like that:

class Company_Interface_Model_Import_Product extends Mage_Core_Model_Abstract {

    public $_someVariableSetInProductClass = 'test';

    public function _construct()
    {
        parent::_construct();
        $_someVariableSetInProductClass = 'not working in _Categories';
    }
}

Then I receive the value 'test' in _Categories. It seems _Product _construct() is not setting the value when using methods from _Categories.

The questions:

Is this not working because * _Product class _construct() method is not called when class * _Categories testAction() is called? I thought that parents are always initialized when children has parent::_construct() in its construct method.
Is there any error in the code that could point this case in my thinking error?
Is there other way to pass properties between related classes?

Thanks in advance.

Solution

It seem like _construct() method in _Categories class is overriding the function _construct() in _Product. Removing _construct() completely from _Categories solved the issue.

class Company_Interface_Model_Import_Product_Categories extends Company_Interface_Model_Import_Product {

   public function testAction()
   {
      var_dump($this->_someVariableSetInProductClass) //returns 'test'

   }
}

Update 2 - Reason

I've kept searching what was the small reason to have such big impact and I have to admit this was due poor coding and probably a tiredness.
This couldn't be seen in my example cause I've didn't put it there.

Generally the _Catalog class can have _construct() method but you have to be 100% sure that parent::_construct() is called BEFORE applying any values to _Catalog class properties - somehow they're not appended later and don't call the _Product class _construct() method unless it's called first.

So proper code would be:

class Company_Interface_Model_Import_Product_Categories extends Company_Interface_Model_Import_Product {
    public $_test = null;

    public function _construct()
    {

        parent::_construct();

     // This is the reason, the lines were inversed in this method.

        $this->_test = 'testing works';

    }

    public function testAction()
    {
        var_dump($this->_someVariableSetInProductClass) //return 'test';
        var_dump(this->_test); //return 'testing works.'
    }
}


texts: Magento 2 - Save data of customer from a form in database

texts:
I wish I could create a form with several inputs dedicated to the customer's attributes in my first custom checkout step.
This form will have to save the data in the database, in the customer information. Is there a module that allows you to do this?


texts:
I'm currently applying patch SUPEE-6788 to a store that is running Magento CE 1.9.1.0 (it says so at the bottom of the admin panel).

When it comes to selecting the version for the patch, I'm a bit confused:

Do I have to select "SUPEE-6788 for CE 1.9.1.0", as that is the latest update of Magento that I've installed?
Do I have to select "SUPEE-6788 for CE 1.9.2.1", as I have already installed all previous patches, making my Magento installation identical to a 1.9.2.1 installation?


texts:
all!
I'm implementing my custom API and want to send 2 parameters for my method.
Here is my code:

app/code/Openc/GCApi/etc/module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
     <module name="Openc_GCApi" setup_version="1.0.0" />
</config>

app/code/Openc/GCApi/etc/webapi.xml

<?xml version="1.0"?>
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../app/code/Magento/Webapi/etc/webapi.xsd">
<route url="/V1/opencGCApiGcapiapiStock/update/:productId/:data" method="POST">
<service class="Openc\GCApi\Api\GcapiapiStockInterface" method="update"/>
<resources>
    <resource ref="anonymous"/>
</resources>

app/code/Openc/GCApi/Api/GcapiapiStockInterface.php

<?php
namespace Openc\GCApi\Api;
interface GcapiapiStockInterface
{
    /**
     * Returns greeting message to user
     *
     * @param string $productId
     * @param string[] $data
     * @return bool
     */
     public function update($productId = NULL, $data);
 }

app/code/Openc/GCApi/Model/GcapiapiStock.php

 <?php
 namespace Openc\GCApi\Model;
 use Openc\GCApi\Api\GcapiapiStockInterface;
 class GcapiapiStock implements GcapiapiStockInterface
 {
      /**
       * Returns greeting message to user
       *
       * @param string $productId
       * @param string[] $data
       * @return bool
       */
       public function update($productId = NULL, $data)
       {
           $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/test.log');
           $logger = new \Zend\Log\Logger();
           $logger->addWriter($writer);
           $logger->info(print_r($productId, true));
           $logger->info(print_r($data, true));
           return false;
       }
  }

app/code/Openc/GCApi/etc/di.xml

 <?xml version="1.0" ?>
 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
        <preference for="Openc\GCApi\Api\GcapiapiStockInterface" type="Openc\GCApi\Model\GcapiapiStock"/>
 </config>

app/code/Openc/GCApi/registration.php

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
      \Magento\Framework\Component\ComponentRegistrar::MODULE,
      'Openc_GCApi',
       __DIR__
);

But in my custom log file I'm getting empty array as second parameter:

2017-11-06T16:12:26+00:00 INFO (6): 1
2017-11-06T16:12:26+00:00 INFO (6): Array
 (
 )

Fragment of my test script:

$result = $request->opencGCApiGcapiapiStockV1Update(array('productId' => 1,
'data' => array('qty' => 26, 'is_in_stock' => 1, 'manage_stock' =>1, 'use_config_manage_stock' => 1, 'use_config_backorders' => 1, 'backorders' => 1)));

Could you please tell what can be the problem?
Thanks,


texts: Magento2 Uncaught SyntaxError: Unexpected token B in JSON at position 121

texts:
Product detail page showing this error for some products

Uncaught SyntaxError: Unexpected token B in JSON at position 121<br>
   at JSON.parse (<anonymous>)
   at getData (main.js:58)
   at Array.map (<anonymous>)
   at HTMLDocument.apply (main.js:74)
   at fire (jquery.js:3232)
   at Object.fireWith [as resolveWith] (jquery.js:3362)
   at Function.ready (jquery.js:3582)
   at HTMLDocument.completed (jquery.js:3617)

Please help me to fix this....


texts:
Magento2 shows this error:

Circular dependency: Magento\Customer\Model\Session depends on Magento\Customer\Model\Url and vice versa.

I have cleared var/cache and var/generation directory. But it doesn't work.
Does anyone know how to solve it?


texts: How to get the selected custom options of a item in wishlist?

texts:
I need to retrieve the selected custom options of the item in the wishlist. I tried the following code.

$item = Mage::getModel('wishlist/item')->load($wishlist_item_id);

$options = $item->getProductOptions();

//$options = $item->getOptions();
print_r( $options);die();

but it shows empty array. How to retrieve the selected options of the wishlist item?


texts: Is it possible to extract stock movement for each product between a time period, through a api call?


texts: Magento 2 product listing page quantity increment decrement button

texts: I am trying to make quantity increment plus minus button on product listing page for magento 2. I have see php cuong made a good module but that only works on details page. How I can add functionality on listing page.


texts:
Am shift from window to Ubuntu 18.04 I run clean, flush, upgrade and also deploy commands But page layout still destroy.
When I face this issue in the window then just run deploy command, page structure would right. But in Ubuntu it still destroys
Why ? which command I run to fix the layout.


texts: Magento 2 : What's the proper location to put repositories?

texts:
In Magento 2.1:

When I look at the customer module, I note that the customer repository is located in the folder for resource models:

Magento\Customer\Model\ResourceModel\CustomerRepository

But when I look at the catalog module, the repositories are located in the model folder:

Magento\Catalog\Model\ProductRepository
Magento\Catalog\Model\CategoryRepository

So what's the proper convention for when it comes to the location of repositories?


texts: Localhost install Theme. Problem with 'bin'

texts:
I have localhost E:\xampp and i have a problem with 'bin' environment variable

bin/magento setup:upgrade
bin/magento index:reindex
bin/magento cache:clean


texts: Customer Rating options for different attribute sets or categories

texts:
I want to display different customer rating options assigned to different categories or attribute sets.

So for example, in category A or attribute set A, we have a price rating, but in category B or attribute B, we only have quality rating.

Is this possible or is there an extension for this?


texts: Magento2 Thai S3 extension for S3 Bucket getting 403 error

texts:
Magento2.3.2 I am using below extension for S3 Bucket.

https://github.com/thaiphan/magento2-s3

The issue I am facing is when I try to upload images from admin to a product I get 403 forbidden error & image doesn't get uploaded  to S3 Bucket.
I am in a big trouble due to this, can some guide me on this?
Thanks in advance.


texts: I want to call register form in my popup , and it's call from default.xml via block

texts:
I want to call register form in popup and i tried by below code from default.xml

<referenceContainer name="page.wrapper">
   <container name="registerpopup" as="registerpopup" label="registerpopup" htmlTag="div" htmlClass="overlay" htmlId="registerPopup" after="page.main" before="footer.container">
       <block class="Magento\Customer\Block\Form\Register" name="customer_form_register" template="Magento_Customer::form/register.phtml" />
   </container>
</referenceContainer>

When i submit the form it nothing do, and not register any customer


texts: How to save array values with configWriter in Magento 2 core config data?

texts:
I want to save some data which is in array form and used this to save array but it will save Array keyword in this How to save array values with this.
$this->configWriter->save('my/path/whatever1',  $newdata, $scope = ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeId = 0);


texts: Magento 1.9 what is skulink tag in product description

texts:
I am working on a Magento project where they use skulink that looks something like this {{skulink sku='PowerOptions' text='power options'}}.

It creates an <a> element with a link a category page that displays power cables. The thing is, I don't know how the skulink works, like where do I get the sku name to create this link in the first place. I don't know what it's called and all my searching online has turned up nothing.

Can someone let me know what this is and how to use it? I would ask the people who's site I am working on, but they can sometimes take days to respond to questions, and I would like to work on this sooner.

BTW, I need to figure out what it's called because it is not updating with canonical URL like it's supposed to so I need to be able to fix that issue.


texts: How to add custom information to an order item in Order Sale Email in Magento 2.2.4

texts:
The default email Order Confirmation Template includes the Order Items Grid variable.

I need to add custom information to the first column.
By default, the first column in the grid looks contains just the item name and item SKU.
I need to call my own function for each item and generate a code that needs to be added right after item SKU.

Where do I do it programmatically?


texts: Manipulate package weight before shipping rates calculation

texts:
I need to add some logic to weight package calculation before shipping rates are calculated. So I created a custom module with an observer on sales_quote_address_collect_totals_after event.

The observer looks like this

use Magento\Framework\Event\ObserverInterface;

class AfterCollectTotals implements ObserverInterface{

   public function execute(\Magento\Framework\Event\Observer $observer){

    foreach ($items as $item) {

         // My custom logic here to get the correct weight in $weight

    }
        $observer->getQuote()->getShippingAddress()->setWeight($weight);
    }
}

Weight appears to be set correctly, but when the Shipping Rates are calculated this value is ignored.
In the carrier model, $request->getPackageWeight() returns the package weight before my manipulation.

Where am I wrong?

Thank you


texts: Slow Catalog pages Magento 2.4 - Large database - 30+seconds first page load

texts:
We have been working on a Magento 2.4 multi store.
On Dedicated server, 24 Cores, 192GB RAM, MySQL 5.7, PHP 7.4
One of the stores has 300k SKU.
When loading the homepage and product pages, the speed is not so bad however when loading a brand page or category page, the load time is 30+ seconds first page load and 2 seconds on second page page load.
We had a specialist investigate, and his reply is to do the following:
......................................
*Ask Magento to consider in their base code for the 3 queries identifiable from the slow query log content
(Magento may find there are one, two or three queries involved in this sequence)
A) changing any
website_id = '2'

to
website_id = 2

This will:

avoid overhead of datatype conversions for this int datatype field to conserve CPU cycles
allow the optimizer to choose the correct index to use for the table.

and
B) changing any
ORDER BY rand() ASC

to
ORDER BY e.entity_id

to avoid rand() overhead.*
EXPLAIN SELECT .....
before and after will go from ~ 1,225,644 rows examined to less than 100 rows examined
which take more than 20 seconds
......................................
My Question, Do these suggestions have validation and is it possible to make these changes without breaking Magento?
Looking forward to any advice on this matter.
Thank you
Regards,
Mick O


texts: setCategoryIds() changes product visibility to "Catalog,Search"

texts:
Can somebody explain why setCategoryIds($ids) changes the product's visibility to Catalog,Search from whatever else it was (in my encounter, I was working with Search-view products)?

Here's the code that makes all of the products in $categoryId to have visibility Catalog,Search after the save() when they originally had Search. I restored all of my products and tested it to verify as well.

$productCollection = Mage::getModel('catalog/category')->load($categoryId)
    ->getProductCollection()
    ->addAttributeToSelect(array('name','price','special_price','sku','small_image'));

foreach($productCollection as $product) {
    $catIds = $product->getCategoryIds();
    $product->setCategoryIds($catIds);
    $product->save();
}


texts: skip default luma images generation during static content deployment in magento cloud

texts:
I have a requirement where I need to skip the images that were generated by the static-content: deploy in Magento.

In my local and the test environments have --no-images option. But how can I implement this in the Magento cloud environment? Please note that I need to compile the luma store theme but not the images of the luma store.

Please advise.


texts:
I've recently set my site up with Varnish full_page cache, and I have one specific URL that seems to be "stuck" and I am not able to clear it from the cache.

Last night I went into maintenance mode to do some updates, and this morning one URL is still showing the maintenance page, I guess because it got crawled while the site was down. All the other URLs I've tested are working but this specific one won't load.

This is production so I don't want to do anything crazy, I just want to clear that one page's cache and nothing I've tried works.

I have tried restarting Varnish at the command line but that does not work. Nor does clearing Magento cache on the front end.

I can disable full_page cache at the command line, and then I can see that the page loads properly. Then I restarted Varnish, and turned full_page cache back on, and the page then responded once again with the "Maintenance" page. So Varnish is hard-caching the page response, but how do I purge it?

Magento 2.3.2 and Varnish 6.0.3


texts: Want to bind my custom grid with existing core database table of magento 2

texts: I have created a custom module under system tab. Now I want to create a custom grid on that page and binds this grid with the core magento database table "directory_country_region".


texts: Edit wishlist configurable item has wrong URL

texts:
Have an issue with a Magento 1.6 store. When i have a configurable product in the wishlist and i select edit for that individual item it takes me to a wishlist version of that product page, all good.

I change my product options and select update wishlist button. At this point i get returned back to the wishlist index page and i can see none of the configurable options are updated!

I track this down to an issue with the Mage Core Wishlist indexController. Around line 267 you have this code:

        $productId = (int) $this->getRequest()->getParam('product');
    if (!$productId) {
        $this->_redirect('*/');
        return;
    }

Simple, it gets the product parameter from the url. but the if statement redirects me back to the wishlist page because there is no parameter "product" in the url so this action always fails. I do however see there is an ID parameter in the url which seems to

Is this a known bug in magento? Or has anyone come across it?

if so how did you fix?

Thanks

EDIT

I have manually added an extra parameter to the url using the Core/Url helper to do so and it works fine. But id still like to know what is happening here


texts:
I'm trying to test my shop with PayPal Sandbox.
I get 2 different errors in 2 different situations.
1. All works fine till finishing order in PayPal.
Then get message:

  We're sorry, PayPal doesn't allow residents of United States to ship purchases to (anywhere)

2. second situation is when I then change my buyer shipping address to US. I get following error, on first page in paypal:

  Unable to process payment. Please contact the merchant as the shipping address provided by the merchant is invalid, and the merchant has requested that your order must be shipped to that address.

I found out form here, that this seems to be problem for many. From here I found out that there is something to do with address_override method and here is suggested to turn it off.
Is there a way to turn it off in Magento? Is it safe to turn it off? Why is it there in a first place? or what other solutions are out there? :

I found address_override method in magento at

  \app\code\core\Mage\Paypal\Model\Api\Standard.php line:238
  $request['address_override'] = 1;

Changed it to '0' and now paypal sandbox works. No errors anymore. But how can I do this without changing magento core files ? and is it safe?


texts:
I have some products with stock which are not appearing in my flat store table.
I would like to understand why these products are not handled by the indexer.
Can anyone tell me where magento is going to create the flat product store rows from the product entities ?


texts: Duplicate product/view tabs element in Magento 2

texts:
I want to duplicate the product/view tabs element on the product view page in Magento 2.

I have copied the existing tabs layout data in catalog_product_view and duplicated it but only one instance of the block is shown on the product view page.

Can anyone please tell me how I get this working?


texts: Magento2 - Get ID for simple product which is associated to configurable product on product listing page

texts:
I want to pass product id in a rel tag in the swatch-option class which is on the listing page for swatches.

I am aware it has to be done via swatch-renderer.js but not able to do the code.

console.log($.widget.options);
                id = this.id;
                type = parseInt(optionConfig[id].type, 10);
                value = optionConfig[id].hasOwnProperty('value') ? optionConfig[id].value : '';
                thumb = optionConfig[id].hasOwnProperty('thumb') ? optionConfig[id].thumb : '';
                label = this.label ? this.label : '';
                attr =
                    ' id="' + controlId + '-item-' + id + '"' +
                    ' aria-checked="false"' +
                    ' aria-describedby="' + controlId + '"' +
                    ' tabindex="0"' +
                    ' option-type="' + type + '"' +
                    ' option-id="' + id + '"' +
                    ' option-label="' + label + '"' +
                    ' aria-label="' + label + '"' +
                    ' option-tooltip-thumb="' + thumb + '"' +
                    ' option-tooltip-value="' + value + '"' +
                    ' role="option"';


texts:
I have a new job where I strictly work on Magento everyday now.  I have no prior experience with Magento so it's been a challenge to say the least so far!

Let me explain briefly the extension we are building.

It will allow us to show a Popup/Modal window.  The Modal's HTML content will be stored in
a Static Block

ADMIN PAGE

So the Admin panel consist of a new Tab under System/Confuration/NEW TAB

The admin panel allows you to select in a drop down list on that NEW TAB PAGE the default Static Block to use for these sections...

HOME PAGE or  HOME PAGE w/Items in Shopping Cart
 ALL CATEGORY PAGES or  ALL CATEGORY PAGES w/Items in Shopping Cart
 ALL PRODUCTS PAGES or  ALL PRODUCTS PAGES w/Items in Shopping Cart
 ALL CMS PAGES or  ALL CMS PAGES w/Items in Shopping Cart
 SHOPPING CART PAGE or  SHOPPING CART PAGE w/Items in Shopping Cart

DEFAULT OVER-RIDES

Next the actual CMS, CATEGORY, and PRODUCT pages all allow the same settings that the Admin Panel page has, except they allow you to set a STATIC BLOCK on a per-item basis and over-ride the default setting that we had in the admin settings above.

So far we have the admin side of the extension done.  We have all the admin tabs for each section... product, category, CMS, and Configuration page.

Next step will be to add on to the same extension and make a Static Block insert into the page.  This Static Block will be responsible for... Showing the correct Static Block on each page based on the settings that were set in the above mentioned areas.....

Determining the page we are on, and the page type (cms, product, home, category)
It will then have to read all the custom settings that were set in the above mentioned areas.
If it is determined we are on a Category page, we will then have to get the actual specifiv Category we are on.  For example Category 3.  We will then see if there is a specific setting for that specific category.  If it says Enabled we will then look for which Static Block is saved for that category and show it in our main Static Block on the page!
If the above Specific Category is set as Disabled for our Modal Window then we will look higher up in the more global settings for the Modal and see if a Modal is Enabled for all categories.  If yes, then we will see which Static Block is set to be shown to all categories.
In addition to all this, it will do this process for each of out main page types (product, categories, cms, home, cart)
We will also have to check if the shopping cart is empty or not.  IF not empty...then we will have to take that into consideration above when wqe are checking which Static Block to show for that page as each setting allows for a Static Block to be set for empty cart and 1 for not empty cart! (I know this is a massive hard and large undertaking but we have the admin side done mostly.  Just need to do the part that takes all those into account in determining which Static Block to show on which particular page.

So to get me in the right direction I have a couple of smaller questions...

How can I inside my Static Block code (the PHP part) determine which TYPE of PAGE I am on.  Like I mentioned I need to know if I am on.... HOME PAGE, a CMS PAGE, a CATEGORY PAGE, a PRODUCT PAGE, or the SHOPPING CART PAGE ?
In addition to the PAGE TYPE I need to get the actual page.  So if I am on Product id 1234 then I need to be able to get the  setting (static block set for that page) for that particular page.

I know this has been a long and possibly confusing post.  If you made it this far, thank you for taking your time to read this =)

If you can assist with my question, each little chunk will get me closer to the end goal

Below is a Flow chart I made of how my module will need to work to determine which static block to insert into the page


texts:
I create a new Order Status: Synced To B1
in Sales > Orders Status is empty for orders having this new status, but when I open order the status is here
Do you have any Idea How to show custom status in orders list grid?

Note That  I Updated the Status using REST API by POST to:
/rest/all/V1/orders/64/comments

{
  "statusHistory": {
    "comment": "Success Imported to SAP DocNum:89441",
    "created_at": "2019-06-03 08:20:27",
    "parent_id": 64,
    "is_customer_notified": 0,
    "is_visible_on_front": 1,
    "status": "SyncedtoB1"
  }
}


texts: From which table I will get subcategory name?

texts: Can anyone tell me the table from where I will get subcategory name. I want to fire query using table.


texts: Get customer group name from customer group ID

texts:
I need to use the customer group name in the invoice. Based on $order I can get the customer group ID.

$customerGroupId = $order->getCustomerGroupId();

I tried the following code:

$groupname = Mage::getModel(‘customer/customer_group’)->load($customerGroupId);

This results in the following error:

Fatal error: Call to a member function load() on a non-object

How can I get the group name?


texts: Shipment / tracking creation slow in admin

texts:
We have a problem with creating shipments in magento.

It's taking over a minute to create a shipment and e-mail the customer.

The problem started two weeks ago, and I have checked the logs and opened the firebug console during shipment creation. They all show no errors, only that it indeed takes about a minute to create the shipment (around 67 seconds).

Invoices can be created without a problem. Invoices with a tracking number are also taking a long time ofcourse.

We also emptied most of the abandoned carts, because it was the biggest log in the database. The other known big logs are being cleaned every night.

One extension that uses the shipment creation has been turned off, but unfortunately that didn't work.

Any idea what we could try next? Is there a tracking number log in Mysql we should empty?

We are using magento 1.8.0 and only flatrate shipping options (nothing with an API).


texts: Magento 2 : System Range Validation for Multiple Fields

texts:
In my system.xml, I have these two fields

I want frontend validation between these two fields. So that maximum days can not be less than minimum days.

<field id="deliverydays" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
      Minimum days
      <frontend_class>validate-number validate-digits reminder-greater validate-greater-than-zero</frontend_class>
</field>

<field id="maximumdeliverydays" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
    Maximum days
    <frontend_class>validate-number validate-digits reminder-greater validate-greater-than-zero</frontend_class>
    <backend_model>Vendor\Module\Model\System\Config\Backend\MaximumInterval</backend_model>
</field>

I applied backend model and checked value of maximum days against minimum days. Which works fine.

But I don't know how to apply frontend validation here.


texts: Get All Items including Disabled Products in Product Collection

texts:
I want to get all products including disabled and enabled in one of my static page.

I am fetching product collection like

$videoProduct = Mage::getModel('catalog/product')->getCollection()
    ->addAttributeToSelect('*')
    ->addFieldToFilter('manufacturer_value', array('in' => array($brand)))
    ->addAttributeToFilter('is_option', 0);

Where $brand is an array of multiple ids'.
To get all products I read somewhere to disable relation between product flat table.

It does not work for me to set "NO" to catalog flat table relation under magento admin panel.

Anyone let me know if I can get it via getCollection() method.


texts:
I am using Magento 1.9. In backend Manage Customer under Account  Customer Account Creation on  it shows wrong date.

I can't able to point out the problem can any one suggest this problem

in config.xml

<general>
            <locale>
                en_US
                <timezone>Asia/Calcutta</timezone>
            </locale>
        </general>

in mage.php

//date_default_timezone_set('UTC');
                date_default_timezone_set('Asia/Calcutta');


texts:
Fatal error: Uncaught Error: Call to a member function isSuggestionsAllowed() on null in /opt/lampp/htdocs/magx/var/view_preprocessed/pub/static/vendor/magento/module-search/view/frontend/templates/form.mini.phtml:27 on line 27
I have installed a new theme in Magento 2.3.6 which is
https://www.hiddentechies.com/etrend-lite-free-magento-2-theme.html
But when i install this theme and applying on frontend i am getting this error.
Here is my form.mini.phtml.
    <?php $helper = $this->helper(\Magento\Search\Helper\Data::class);
$configProvider = $block->getData('configProvider');
?>

div class="block block-search">

<?= $block->escapeHtml(__('Search')) ?>

        <form class="form minisearch" id="search_mini_form"
              action="<?= $block->escapeUrl($helper->getResultUrl()) ?>" method="get">

                    <?= $block->escapeHtml(__('Search')) ?>

                    <input id="search"
                            <?php if ($configProvider->isSuggestionsAllowed()):?>
                               data-mage-init='{"quickSearch":{
                                    "formSelector":"#search_mini_form",
                                    "url":"<?= $block->escapeUrl($helper->getSuggestUrl())?>",
                                    "destinationSelector":"#search_autocomplete",
                                    "minSearchLength":"<?= $block->escapeHtml($helper->getMinQueryLength()) ?>"}
                               }'
                            <?php endif;?>
                           type="text"
                           name="<?= $block->escapeHtmlAttr($helper->getQueryParamName()) ?>"
                           value="<?= /* @noEscape */ $helper->getEscapedQueryText() ?>"
                           placeholder="<?= $block->escapeHtmlAttr(__('Search entire store here...')) ?>"
                           class="input-text"
                           maxlength="<?= $block->escapeHtmlAttr($helper->getMaxQueryLength()) ?>"
                           role="combobox"
                           aria-haspopup="false"
                           aria-autocomplete="both"
                           autocomplete="off"
                           aria-expanded="false"/>

                    <?= $block->getChildHtml() ?>

                <button type="submit"
                    title="<?= $block->escapeHtmlAttr(__('Search')) ?>"
                    class="action search"
                    aria-label="Search"
                >
                    <?= $block->escapeHtml(__('Search')) ?>
                </button>

        </form>


texts: Magento 2.1.2 - Product Backend EAV Attribute Field Enabled or Disabled Depends on Product Status

texts:
I have added an EAV attribute named disabled_date. I would like to attach an observer to the attribute field on product page where it is disabled if product status is enabled (1) and enabled if product status is disabled (2).

I have tried using product form modifier:

$path = $this->arrayManager->findPath('disabled_date', $meta, null, 'children');
$meta = $this->arrayManager->merge($path . static::META_CONFIG_PATH, $meta, [
    'imports' => [
        'disabled' => '!${$.provider}:data.product.status:value',
    ],
]);

The target field is always enabled because product status is always true (product enabled = 1, product disabled = 2).

I also have used these approach and it did not work.

'disabled' => '${$.provider}:data.product.status:value == 2'
'disabled' => '${$.provider}:data.product.status:value == 2 ? true : false'

Is there any other way to achieve this condition?


texts: Magento admin category Tabs: general or General Information

texts:
I am creating a module that slots in a new field in the category editor.

$installer->addAttribute('catalog_category', 'mapped_objects', array(
    'group'             => 'General Information',
    'type'              => 'text',
    'backend'           => '',
    'input_renderer'    => '',
    'label'             => 'Mapped Data',
    'class'             => '',
    'global'            => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE,
    'visible'           => true,
    'required'          => false,
    'user_defined'      => false,
    'searchable'        => false,
    'filterable'        => false,
    'comparable'        => false,
    'visible_on_front'  => false,
    'unique'            => false,
    'is_configurable'   => false,
    'order'             => 99999
));

The issue is that it would seem that some magento versions use 'General' and some 'General Information' for the Group name.

Can anyone pinpoint when this changed? (which versions are 'general' and which are 'general information')

TIA


texts:
I am getting the 'Gettting SQLSTATE[HY000]: General error: 3 Error writing file '/tmp/MYnJ22go' (Errcode: 28) in magento' when open a particular page in magento-1.9
I give write permission to my tmp folder,but no use. Still any thing I need do change to solve this.
Please advise me .I am new to magento. Thanks.


texts: I'm using magento 2 and I'm trying to get the visual swatches (color, size..) on the sidebar, on the caterogy pages. I've got the visual swatches for on the product page , but on the sidebar is just text..


texts: SAML/SSO for magento admin and module application?

texts:
I created a module for my admin panel that requires me to login to Magento's admin panel, click the menu link to my module, then login to my module application, which is external.

I would like a solution to auto login and logout the admin user to magento and my application, instead of having to login to each separately.

I think it also poses a security risk, since my module application doesn't logout the user signed in when they log out of Magento. So if someone else logs in with the same computer, the application would already have the previous user logged in. Which means the new user can see the previous users information within that module.

Please advise me on a way to solve this problem, to create a single login situation. the current application already offers SSO. I've never used SSO before so i'm clueless to what to do and where to start, so please be detailed with your answers.

Thanks you.


texts: Custom Attribute with custom Source is not appearing in Layered Navigation Magento1

texts:
I have created several attributes and want now to filter on them.

I create the attributes with these values:

$defaults = [
    'required' => false,
    'comparable' => true,
    'filterable' => true,
    'filterable_in_search' => true,
    'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
    'is_configurable' => false,
    'is_html_allowed_on_front' => true,
    'searchable' => true,
    'unique' => false,
    'used_for_sort_by' => true,
    'used_in_product_listing' => true,
    'user_defined' => true,
    'visible' => true,
    'visible_on_front' => true,
    'visible_in_advanced_search' => true,
];

and also specify the respective attribute with this:

'cut' => [
        'type' => 'varchar',
        'input' => 'select',
        'label' => 'Cut',
        'group' => MyCustom_Catalog_Helper_Data::EAV_ATTRIBUTE_GROUP_NAME,
        'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
        'source' => 'mycustom_catalog/product_attribute_source_cut'
    ]

Both arrays are getting merged correctly while creating the attributes.

In the source model, I have declared getFlatColumns() and getFlatUpdateSelect() like this:

public function getFlatColums()
{
    $attributeCode = $this->getAttribute()->getAttributeCode();
    $column        = [
        'unsigned' => false,
        'default'  => null,
        'extra'    => null,
    ];

    if (Mage::helper('core')->useDbCompatibleMode()) {
        $column['type']    = 'varchar';
        $column['is_null'] = true;
    } else {
        $column['type']     = Varien_Db_Ddl_Table::TYPE_VARCHAR;
        $column['nullable'] = true;
        $column['comment']  = '';
    }

    return [$attributeCode => $column];
}

public function getFlatUpdateSelect($store)
{
    return Mage::getResourceSingleton('eav/entity_attribute')
        ->getFlatUpdateSelect($this->getAttribute(), $store);
}

If I edit my products now and set the filter for cut, I can see the data being in the Flat Table, however the Value does not appear in catalog_product_index_eav.

I have re indexed all indexers after every new try and also cleared the cache.

Objective: I want to have the Attribute being filterable and visible in the Filter Layered Navigation.

What am I doing wrong?


texts: Is there any way to identify what class causes 'Area code is not set' or 'Area code already set'?

texts:
I know there are a lot of questions about 'Area code is not set', but no one has yet answered the main question. How to find the file which caused this Exception?

In my case, I updated a lot of modules with thousand lines, and now I get this Exception...Magento 2 makes me cry :(

Thanks for any thoughts. :)

UPD: The error appeared after updating the Magento to 2.2


texts: Magento 2 - How to remove parent categories slug from subcategory URLs to make it shorter?

texts:
I want to remove the trailing category in magento 2

http://magento2.dev/accessories/tops-women.html
http://magento2.dev/accessories/tops-women/jackets-women.html

instead I want

http://magento2.dev/tops-women.html
http://magento2.dev/jackets-women.html


texts: Magento 2 - can't upload images in CMS (File validation failed.)

texts:
I try to upload a small (900 KB) .jpg image to my CMS Site, but I get File validation failed.

I made sure that I have all necessary permissions as stated in the magento documentation.

find . -type f -exec chmod 664 {} \;
find . -type d -exec chmod 775 {} \;
find var pub/static pub/media app/etc -type f -exec chmod g+w {} \;
find var pub/static pub/media app/etc -type d -exec chmod g+ws {} \;
chmod u+x bin/magento

But the error still appears. I am using Magento 2.3.2 with PHP Version 7.2.5


texts: Enterprise_Index_Exception with message "Can't lock indexer process"

texts:
I am seeing above message in list view of scheduler. The status is "Success" though. Last updated time of the lock file in var/locks is keep changing to latest time, meaning the it's been used. I am just wondering if this is a the planned behaviour? Or something wrong?

exception 'Enterprise_Index_Exception' with message 'Can't lock indexer process.' in /var/www/app/code/core/Enterprise/Index/Model/Observer.php:140
Stack trace:
#0 [internal function]: Enterprise_Index_Model_Observer->refreshIndex(Object(Aoe_Scheduler_Model_Schedule))
#1 /var/www/app/code/core/Mage/Cron/Model/Observer.php(326): call_user_func_array(Array, Array)
#2 /var/www/app/code/core/Mage/Cron/Model/Observer.php(263): Mage_Cron_Model_Observer->_processJob(Object(Aoe_Scheduler_Model_Schedule), Object(Mage_Core_Model_Config_Element), true)
#3 /var/www/app/code/core/Mage/Cron/Model/Observer.php(89): Mage_Cron_Model_Observer->_processAlwaysTask('enterprise_refr...', Object(Mage_Core_Model_Config_Element))
#4 /var/www/app/code/core/Mage/Core/Model/App.php(1338): Mage_Cron_Model_Observer->dispatchAlways(Object(Varien_Event_Observer))
#5 /var/www/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Aoe_Scheduler_Model_Observer), 'dispatchAlways', Object(Varien_Event_Observer))
#6 /var/www/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('always', Array)
#7 /var/www/cron.php(77): Mage::dispatchEvent('always')
#8 {main}