texts: setup:upgrade results in error: /var cannot be accesed (but has 777) Magento2

texts:
Im trying to installing a new plugin, but it keeps saying that the magento-php-script has no access to /var, but /var has chmod 0777. All childrenfolders have 777, except for composer_home which has 777 as well.

  [Exception]
  Missing write permissions to the following directories:
  '/home/ccsammelfiguren/public_html/var'

However, I need to upgrade the instance in order to activate the module I want to install. If I keep the module in the filesystem, I get an exception error with following content:

a:4:{i:0;s:208:"Please upgrade your database: Run "bin/magento setup:upgrade" from the Magento root directory.
The following modules are outdated:
Magenest_ProductLabel data: current version - none, required version - 1.0.0";i:1;s:2748:"#0 [internal function]: Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#1 /home/ccsammelfiguren/public_html/vendor/magento/framework/Interception/Chain/Chain.php(67): call_user_func_array(Array, Array)
#2 /home/ccsammelfiguren/public_html/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'front-controlle...')
#3 /home/ccsammelfiguren/public_html/vendor/magento/module-page-cache/Model/App/FrontController/VarnishPlugin.php(55): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
#4 [internal function]: Magento\PageCache\Model\App\FrontController\VarnishPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#5 /home/ccsammelfiguren/public_html/vendor/magento/framework/Interception/Chain/Chain.php(67): call_user_func_array(Array, Array)
#6 /home/ccsammelfiguren/public_html/vendor/magento/framework/Interception/Interceptor.php(136): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'front-controlle...')
#7 /home/ccsammelfiguren/public_html/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(73): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#8 [internal function]: Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#9 /home/ccsammelfiguren/public_html/vendor/magento/framework/Interception/Interceptor.php(140): call_user_func_array(Array, Array)
#10 /home/ccsammelfiguren/public_html/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
#11 /home/ccsammelfiguren/public_html/vendor/magento/framework/App/Http.php(115): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#12 /home/ccsammelfiguren/public_html/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#13 /home/ccsammelfiguren/public_html/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#14 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";}

Seems like the module isnt acknoledged by magento since setup:upgrade wasnt successful. I already tried to manipulate the FilePermissions.php and tried to find broken symlinks (there are none).

Any idea, maybe?


texts: Magento 2: How to set custom template for core block

texts:
I'm trying to override the register.phtml in my module, but it seems there are some config problem that make Magento unable to use my custom template to override the one in core module. I've checked the code but can't find the problem. Anyone can help? Thanks in advance.
module.xml:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Namespace_ModuleName" setup_version="0.0.2">
        <sequence>
            <module name="Magento_Customer"/>
        </sequence>
    </module>
</config>

customer_account_create.xml under Namespace\ModuleName\view\frontend\layout:

<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
    <referenceBlock name="customer_form_register">
        <arguments>

            <argument name="template" xsi:type="string">Namespace_ModuleName::form/register.phtml</argument>

        </arguments>
    </referenceBlock>
</layout>

composer.json:

{
  "name": "namespace/module-modulename",
  "description": "modulename",
  "type": "magento2-module",
  "version": "0.0.2",
  "license": [
    "OSL-3.0",
    "AFL-3.0"
  ],
  "require": {
    "php": "~5.5.0|~5.6.0",
    "magento/framework": "~0.42",
    "magento/magento-composer-installer": "*",
    "magento/module-customer": "*"
  },
  "extra": {
    "map": [
      [
        "*",
        "Namespace/ModuleName"
      ]
    ]
  }
}


texts: REST API enabled products not displaying on front-end

texts:
When loading products via REST API(Oauth) they don't display on the front-end. The status is enabled(1) en inventory(stock_data) is set correct.  We have to manually change status per product and save via admin back-end. Even bulk status change via admin back-end does not work.

What could be the cause of this and how can we fix it?

Magento ver. 1.9.0.1 and PHP Version 5.4.21


texts: How to change the country code for a specific country

texts:
is it possible to change the country code for a specific country?

DE -> GER

Thanks in Advance!


texts: Impossible to upload new products picture

texts:
I have an issue when I try to upload a new picture.
I upload the new picture then select Thumbnail, Small image, Base Image for this mew picture. Then I select Remove for the old picture.
Then I click on Save.
I clear cache and storage.
On the website I still have the old picture.
In the backend, in manage product:

the new picture is uploaded the old picture is defined as excluded (where as I had selected remove) - I can't change "1" in sort order.
the new picture is enabled for thumbnail, small image and base image - sort order is 1

To prevent some problem, I have uploaded the latest version of flash and tried to do the operation through 3 different browser.

Anyway, I can't upload new picture.
Please help me to fix.


texts: Can't check requested quantity for products without Source Items support issue on 2.3.1

texts:
I have a custom module installed . A module that adds product type to display a product. On the product configuration, it offers other sets of parameters(Min, max price & total price target to set as success transaction ) that doesn't align to quantity parameter. It do not required the default quantity

This is the error when user click into add to cart

I believe 1 of these parameters (which is quantity based on error display)is somehow linked & processed when user place the order is unnecessary

And these are the parameter that module provided to work on the backend

I hope someone who has been through a similar situation would kind to share some insight on fix this issue.


texts: Magento1.9 updated orders list programatically

texts:
programatically fetch the magento updated orders list in magento1.9

Thanks


texts:
I am trying to upgrade Magento from 2.3.3 to 2.3.6 but I am getting the below error and the update is not happening.
[RuntimeException]
Failed to clone https://github.com/mageplaza/magento-2-image-optimizer.git, git was not found, check that it is installed and in your PATH env.
sh: 1: git: not found
I have deleted this extension even though the composer is still trying to download the module and I cleared the cache of the composer using the below commands.
// Clear cache
composer clearcache
// OR
composer clear-cache
// Completely remove the cache directory
sudo rm -rf ~/.composer
still, I am getting the above issue only.
for reference please find the attached images.


texts: Why is Magento picking up the wrong database settings from the wrong file in app/etc?

texts:
I'm creating backup copies of my local.xml files in the app/etc. directory for the different sandbox environments I use (e.g. localhost.local.xml,  sandbox.localhost.xml, production.localhost.xml).  I do this out of convenience so they are retained in my git repository.

However, I find that sometimes Magento picks up the wrong database configuration for the environment, not from the local.xml.


texts: I want to enable two-way communication between Magento and Braintree what I mean is I want to update the order status at Magento as the transaction state(settling, settled) changes at Braintree. how can it be achieved?


texts: Magento2 Checkout Page web matrix Shipping Method by default selected

texts:
In Magento 2 checkout page when ship here button click than shipping method radio button by default selected showing but in my site it's not working.
So if anyone knows how to fix this, please reply me.

I have attached below screenshots for looks better idea.


texts:
How To Display Sub Categories list on a Category Page in Magento 2.3
root_catalog
 |-First  |-Shoes
         |-T-shirts
 |-Brands
 |-Demo
 |-Test


texts: Is it possible to set the e-mail logo from update script?

texts: Does anybody know a way to set the e-mail logo (design/email/logo) from a data upgrade script? The config value takes the file path, but where do I have to put the file?


texts: Less file styles not applying in Magento 2

texts:
I have  custom theme in ..../design/frontend/MyVendor/my-theme folder. My main less file is in design/frontend/MyVendor/my-theme/web/css/my-main.less.
Content of the main less file:
@import './source/_module.less';

Location of _module.less file is in the folder
design/frontend/MyVendor/my-theme/web/css/source/_module.less

Contents of _module.less:
@import 'module/_cart.less';
@import 'module/_minicart.less';
@import 'module/_checkout.less';

The way I include my main less file is in default_head_blocks.xml:
<head>
    <link rel="stylesheet/less" type="text/css" src="css/my-main.less" />
    ......

The file is included, no errors anywhere, run the fallowing commands:
magento cache:flush
rm -rf pub/static
rm -rf var/cache
rm -rf var/page_cache
rm -rf var/view_processed
bin/magento setup:static-content:deploy -f

both

magento cache:flush &  bin/magento setup:static-content:deploy -f

run without ANY errors.
Still, the changes I made in module/_minicart.less are no presented when I refresh the page. What is the problem?


texts:
[No Extension pitches please (if I want to be spammed, I'll use the magento forum :D)]

I can see this/similar has been asked before (and elsewhere).
In most cases, I see people 'recommending' extensions - yet this should be doable with some code tweaks ... so I thought I'd ask.

Attribute value Name in the URL, not the ID.

The normal filtered URL looks like this;
  /[attribute_name]=[attribute_id]
  /colour=4

I (and many others) would like to see;
  /[attribute_name]=[attribute_value]
  /colour=red

To do this, I need to alter (a "local" version of);
  /app/code/[code|local]/Mage/Catalog/Model/Layer/Filter/Item.phtml

The default code is;

public function getUrl()
{
    $query = array(
        $this->getFilter()->getRequestVar()=>$this->getValue(),
        Mage::getBlockSingleton('page/html_pager')->getPageVarName() => null // exclude current page from urls
    );
    return Mage::getUrl('*/*/*', array('_current'=>true, '_use_rewrite'=>true, '_query'=>$query));
}

Yet any changes I make here seem to result in the filters not loading properly.

I've been trying this (and variants);

public function getUrl()
{
    if($this->getFilter()->getRequestVar() == 'attribute_1_name'){
    // do nothing
    }
    $query = array(
        $this->getFilter()->getRequestVar()=>$this->getValue(),
        Mage::getBlockSingleton('page/html_pager')->getPageVarName() => null // exclude current page from urls
    );
    return Mage::getUrl('*/*/*', array('_current'=>true, '_use_rewrite'=>true, '_query'=>$query));
}

(Even simply inserting an if (or if/else) condition results in the attributes not loading - nor the footer!)

Now I assume that I need to do the following;
1) Check for a value in the URL
2) Fetch a collection of filterable attributes
3) Look through that list for a match to the URL value
4) get that values ID
5) Pass that ID to magento in the return data.

But I've little clue on what api/funcs exist in magento to achieve this.

Further - I'm not sure if doing this will also update the links in the filter ... it would be pointless to look in the URL for specific attribute values, if the links are pointing to URLs with only IDs ... so will I need to also update whatever file handles the URL creation?

Thank you very much for any assistance you can give.

.
[No Extension pitches please (if I want to be spammed, I'll use the magento forum :D)]


texts: When are rows in catalog_product_super_link not revomed with product removals?

texts:
I found a strange behavior in the way Magento (EE 1.12) housekeeps the catalog_product_super_link table. When an associated simple product is deleted without being disassociated first, the entry corresponding to this link remains. Furthermore, when the disassociated configurable product is re-saved, the orphaned rows remain.

To replicate this, please try

Create a test configurable product and simple product
Associate the two.
Delete the simple product without disassociating.
Check the DB table with the following query.

select l.*, p.sku
from catalog_product_super_link as l
    left join catalog_product_entity as p
        on l.product_id = p.entity_id
where l.parent_id = 1936;

And you'll get something like below where the NULL entries are former associations.

1769    1937    1936    NULL

1770    1938    1936    NULL

1771    1939    1936    NULL

1772    1940    1936    NULL

1773    1941    1936    bag-001

1776    1950    1936    bag-002

Is this normal?


texts: css and Jquery loading problem in magento 2.0

texts:
I install Magento 2.0 & also install a premium themes in Live. I am working with this theme. I finished my work & my website is ready for RUN.  Then I click the "flush Magento Catch" button. Then every thing is going to wrong. My website Css & Jquery is not loaded. Now what can I do?
http://shulov.net


texts: magento 2 hide out of stock products except when a specific attribute equals yes

texts:
I would like to hide out of stock products generally so I've added the option in the store configuration settings. However there are certain products that will be restocked soon. I'd like to keep showing those.
Therefore I decided to add an attribute to them to mark them for restock att_restock.
However I'm not sure how to override the logic so that it works in the category, layered navigation and search results pages now. I've tried other solutions in
Where should I add my plugin in order to add my logic in the selection?
Any help is appreciated.


texts: Magento Product Image Import selection store-wise not working

texts:
I have installed Magento CE-1.9.2.4 in my local system, and created two stores namely "personal"(default) and "business".

Now I want to import a product's images in such a way that both store should show different images for same products in Frontend and Backend.

I am using Admin > System > ImportExport > Import for importing only product-images.

Below is the csv file I am using to import images store-wise.

sku,store,websites,image,small_image,thumbnail,image_label,small_image_label,thumbnail_label,_media_image,_media_attribute_id,_media_is_disabled,_media_position,_media_lable
478,personal,base,/new_products/sample1.png,/new_products/sample1.png,/new_products/sample1.png,Test Image,Test Small Image,Test Thumbnail,/new_products/sample1.png,88,1,1,Test 1
,business,business,/new_products/newImg.png,/new_products/newImg.png,/new_products/newImg.png,Test Image,Test Small Image,Test Thumbnail,/new_products/newImg.png,88,1,1,Test 1 Forhandler

Image upload works fine, but the image selection store-wise doesn't work at all. Both stores take the default store's image selection, which is not desired for me at all.

Can anyone let me know what could be wrong ?


texts: How to import Enterprise URL Rewrites in 1.13?

texts:
We recently migrated from a proprietary shopping cart to Magento Enterprise.

Currently we are using a custom module to redirect the old product URL's to the new Magento product URL's.

However, I am looking to move on from this front-end controller that handles this logic, to importing them as URL rewrite rules.

There seems to be a lot of documentation for creating a URL rewrite url in community edition, which uses the deprecated core_url_rewrite table.

Previously, you would do something like:

$results = Mage::getModel('core/url_rewrite')
    ->setIsSystem(0)
    ->setOptions('RP')
    ->setIdPath($legacy_url)
    ->setRequestPath($legacy_url)
    ->setTargetPath($url)
    ->setDescription('legacy product id '.$legacy_id)
    ->save();

However, in Enterprise 1.13, the model I think I should be using is: enterprise_urlrewrite/url_rewrite

Can someone advise on how to do the equivalent? I can't seem to get it to show up in the admin, even after doing a reindex.

Thanks


texts: How set my main menu (custom link and category) in my shop with two language version?

texts:
How to set my main menu (custom link and category) in my shop with two language version?

On second language version my menu will be translated.

  About us(custom link)  (en)  ->  About us(custom link) (different
  language)

  Category 1 (en)  ->  Category 1 (different language)

  Category 2 (en)  ->  Category 2 (different language)


texts:
I got this error after change to using client-side compilation mode.

Undefined variable: template in /var/www/lamicall/vendor/magento/framework/View/Page/Config/Renderer.php on line 357


texts:
I create a small module who add a button to the wishlist page.
I make a file wishlist_index_index.xml in

Vendor/Module/view/frontend/layout/

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
    <css src="Vendor_Module::css/barcode.css" />
</head>
<body>
    <referenceContainer name="customer.wishlist.buttons">
        <block class="Magento\Framework\View\Element\Template" name="barcode" template="Vendor_Module::wishlist/barcode.phtml"></block>
    </referenceContainer>
</body>
</page>

Everything is working well on luma theme, my button is here.
But when I put a custom theme, the button is not present is I not copy the  wishlist_index_index.xml in my custom theme also.
I'm not sure it's the default behaviour, but in my mind you have to do it only if you want to overide the module template.

Do you know what i'm doing wrong ? i'm not very familiar with magento2 frontend...

Thanks


texts: How to display simple product descriptions on a grouped product page?

texts:
When working with a grouped product on Magento (such as a furniture set), very little info is displayed by default about its simple products.

The demo site example doesn't appear to allow the user to explore any detail of the simples' dimensions or other attributes. All it shows are the names and prices.

Are there any template methods available on a grouped product page to display more detailed data about its component simple products? Things like short descriptions, thumbnails, URLs to simple product view (if active), etc.


texts:
How can I create Date time Instance in Magento For example 11-30-2016 5:00:00 pm.
remember this should be a datetime variable and not a string variable so that I can do Datetime operations on it.


texts: How to remove all Magento Connect Extensions

texts:
I am trying to remove extensions that were previously installed, but the only way I have been able to do it is editing the module files under app/etc/modules and changing

<active>true</active>

to

<active>false</active>

Is there a way to completely remove the extension as if I had never installed in the first place?

When I view my Magento Connect Manager, none of my extensions appear under the existing extensions list.

Thank you!


texts: Magento 2.3.0 Get product attribute name in phtml in CMS Block

texts:
I have a attribute called

  Artist

It has several artist names

XYZ
ABC
RST

I need to be get the artist name associated to the current product page via a call to a phtml in a CMS Block.

What do I need to put in the block file and in the phtml file for this?

I've tried this solution but I'm unsure how to go about it or if even a recommended method of doing it.

UPDATE

What I'm looking for is to use a short code to call the attribute name within the short description block, as follows, rather than changing the view xml file to get and position the attribute name on the product page.

Painting by {{block class="" template=""}} in oil on canvas

Where

{{block class="" template=""}}

= attribute artist name


texts: Magento2- How to Filter Multiple Values in Column

texts:
There is multiselect customer group field in form of my custom module and those values are displayed in grid with comma seperated
Ex.

      Customer group
      General, Wholesaler
      retailer

If we choose retailer then it filtered results but if we select General or wholesaler then it won't and I know I have to do some customization to filter results for multiple values but how can I implement it?


texts: The admin doesn't get emailed when a customer orders something on magento 1.9.3

texts: I have a problem with magento webshop. The order emails are not being send to customers and admin. I dont know where the file is where this is programmed and how to change it. I've also read online that it might be a cron issue so here is my cron config on magento backend.


texts: Magento 2 Auto added product's image missing in the checkout page

texts:
I have created a small module to add a product automatically at cart when a specific coupon code is applied. All is working fine except the product image is missing for the first time, but it shows the image after a refreshing full page.

In my findings, KnockoutJS is working on this section to generate image/dom related stuff. Dom is not being ready properly as the product is added automatically.

I am not really sure what to do. Any help would be appreciated. Thank you.

Update: I added a new repo on GitHub for code review as it contains more codes. Please follow the link.


texts:
I'm trying to display a very simple grid in Magento 2 just for practice, but it keeps giving me the same error, and I can't find where the mistake is. The grid is displayed but no records are found. The console throws the error:

  Uncaught TypeError: Cannot create property '_rowIndex' on number '1'

. When I check the request http://localhost/index.php/admin/mui/index/render/key/[myKey]/?namespace=comment_listing&isAjax=true, it shows a bad formed json response:

{
"totalRecords":1,
"items":[
1,[{"comment_id":"26","product_id":"6","customer_id":"2","customer":"Pablo","comment":"test","created_at":"2017-06-12 12:44:54","updated_at":"2017-06-12 12:44:54"}]
]
}

The "1" in "items" is producing the error. I check the catalog response, and is not formed liked that, in "items" there are no numbers alone, just the records of the table. Any ideas? My listing is:

<!-- Data Config -->

<argument name="data" xsi:type="array">
    <item name="js_config" xsi:type="array">
        <item name="provider" xsi:type="string">comment_listing.comment_listing_data_source</item>
        <item name="deps" xsi:type="string">comment_listing.comment_listing_data_source</item>
    </item>
    <item name="spinner" xsi:type="string">comment_listing_columns</item>
</argument>

<!-- Data Source -->

<dataSource name="comment_listing_data_source">
    <argument name="dataProvider" xsi:type="configurableObject">
        <argument name="class" xsi:type="string">Summa\Comment\Ui\DataProvider\Comment\CommentDataProvider</argument>
        <argument name="name" xsi:type="string">comment_listing_data_source</argument>
        <argument name="primaryFieldName" xsi:type="string">comment_id</argument>
        <argument name="requestFieldName" xsi:type="string">comment_id</argument>
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="update_url" xsi:type="url" path="mui/index/render"/>
            </item>
        </argument>
    </argument>
    <argument name="data" xsi:type="array">
        <item name="js_config" xsi:type="array">
            <item name="component" xsi:type="string">Magento_Ui/js/grid/provider</item>
        </item>
    </argument>
</dataSource>

<!-- Columns -->

<columns name="comment_listing_columns">
    <selectionsColumn name="ids">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="indexField" xsi:type="string">comment_id</item>
            </item>
        </argument>
    </selectionsColumn>
    <column name="customer">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="filter" xsi:type="string">text</item>
                <item name="label" xsi:type="string" translate="true">Customer</item>
            </item>
        </argument>
    </column>
    <column name="comment">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="filter" xsi:type="string">text</item>
                <item name="label" xsi:type="string" translate="true">Comment</item>
            </item>
        </argument>
    </column>
</columns>


texts:
I am using Magento 1.9.1 with all patches installed on a windows machine and i'm getting this error

a:4:{i:0;s:43:"SQLSTATE[08004] [1040] Too many connections";i:1;s:2730:"#0 ..\path\lib\Zend\Db\Adapter\Pdo\Mysql.php(111): Zend_Db_Adapter_Pdo_Abstract->_connect()
#1 ..\path\lib\Varien\Db\Adapter\Pdo\Mysql.php(320): Zend_Db_Adapter_Pdo_Mysql->_connect()
#2 ..\path\lib\Zend\Db\Adapter\Abstract.php(460): Varien_Db_Adapter_Pdo_Mysql->_connect()
#3 ..\path\lib\Zend\Db\Adapter\Pdo\Abstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
#4 ..\path\lib\Varien\Db\Adapter\Pdo\Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array)
#5 ..\path\app\code\core\Mage\Core\Model\Resource.php(179): Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8')
#6 ..\path\app\code\core\Mage\Core\Model\Resource.php(110): Mage_Core_Model_Resource->_newConnection('pdo_mysql', Object(Mage_Core_Model_Config_Element))
#7 ..\path\app\code\core\Mage\Core\Model\Resource\Db\Abstract.php(320): Mage_Core_Model_Resource->getConnection('core_write')
#8 ..\path\app\code\core\Mage\Core\Model\Resource\Db\Abstract.php(350): Mage_Core_Model_Resource_Db_Abstract->_getConnection('write')
#9 ..\path\app\code\core\Mage\Core\Model\Resource\Db\Abstract.php(335): Mage_Core_Model_Resource_Db_Abstract->_getWriteAdapter()
#10 ..\path\app\code\core\Mage\Core\Model\Resource\Db\Abstract.php(360): Mage_Core_Model_Resource_Db_Abstract->_getReadAdapter()
#11 ..\path\app\code\core\Mage\Core\Model\Resource\Db\Collection\Abstract.php(134): Mage_Core_Model_Resource_Db_Abstract->getReadConnection()
#12 ..\path\app\code\core\Mage\Core\Model\Config.php(1354): Mage_Core_Model_Resource_Db_Collection_Abstract->__construct(Object(Mage_Core_Model_Resource_Website))
#13 ..\path\app\code\core\Mage\Core\Model\Config.php(1386): Mage_Core_Model_Config->getModelInstance('core_resource/w...', Object(Mage_Core_Model_Resource_Website))
#14 ..\path\app\Mage.php(491): Mage_Core_Model_Config->getResourceModelInstance('core/website_co...', Object(Mage_Core_Model_Resource_Website))
#15 ..\path\app\code\core\Mage\Core\Model\Abstract.php(208): Mage::getResourceModel('core/website_co...', Object(Mage_Core_Model_Resource_Website))
#16 ..\path\app\code\core\Mage\Core\Model\Abstract.php(213): Mage_Core_Model_Abstract->getResourceCollection()
#17 ..\path\app\code\core\Mage\Core\Model\App.php(608): Mage_Core_Model_Abstract->getCollection()
#18 ..\path\app\code\core\Mage\Core\Model\App.php(466): Mage_Core_Model_App->_initStores()
#19 ..\path\app\code\core\Mage\Core\Model\App.php(349): Mage_Core_Model_App->_initCurrentStore('', 'store')
#20 ..\path\app\Mage.php(684): Mage_Core_Model_App->run(Array)
#21 ..\path\index.php(87): Mage::run('', 'store')
#22 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";}

Can you try to help me to understand why this happens, and what is the best configuration for Mysql?


texts: magento - how to show only configurable product in main category, simple product in sub-category

texts:
I want to know how can I do this. I want to when i click main category, just show configurable product in page, and when i click sub-category, show simple product in page. Please help me in this, it will be really appreciated.
i'm newbie
Thanks


texts: magento2 , setCurPage pagination problem

texts:
I have this code
$collection = $this->orderCollectionFactory->create()
                ->addFieldToSelect(['increment_id', 'global_currency_code', 'status', 'updated_at', 'total_due', 'shipping_address_id', 'total_refunded', 'total_paid'])
                ->addAttributeToFilter('status', ['in' => [
                    Order::STATE_CLOSED,
                    Order::STATE_COMPLETE,
                    Order::STATE_CANCELED,
                ]])
                ->addAttributeToFilter('main_table.created_at', ['from' => $result['from'], 'to' => $result['to']])
                ->setPageSize(self::COUNT_PAGE_SIZE)
                ->setCurPage($p);
            $collection->getSelect()->joinLeft(
                ['orderItem' => 'sales_order_item'],
                "main_table.entity_id = orderItem.order_id",
                ['tax_amount', 'tax_percent']
            );
            $collection->getSelect()->joinLeft(
                ['billingTable' => 'sales_order_address'],
                "main_table.entity_id = billingTable.parent_id AND billingTable.address_type = '{$this->addressType}'",
                ['vat_id', 'country_id', 'city', 'address_type']
            );

For example
This should have 10 orders,
Page 1 -> 5 orders shown
Page 2 -> 5 orders shown
Page 3 -> Same orders from Page 2.

How to make it return empty at page 3 ?


texts: Magento 2 smtp could not open socket in Aws Setup For M2

texts:
My Site is on aws instant and I am used gmail smtp for sending mail from that but I have one sending mail error and try to solve it but not get any solution

This kind of error I find when I send mail throw gmail smtp in my aws setup magento2.

Could not open socket: stream_socket_client():
php_network_getaddresses: getaddrinfo failed: Temporary failure in
name resolution

I check my php info file in that open ssl was all ready enable

And I also try to do some code in abstract.php file

any one can help me how can i solve this thank you


texts: Automatically adding the character * (asterisk) at the input box without doing anything

texts:
I'm working on the compatibility of our client site. Upon checking, I have noted that in the checkout, on the field Postnummer it is automatically adding the character * in the field without doing anything. Below is the screenshot for your reference.

I have inspected the input box and below is the screenshot:

The above-said issue appears only in mobile devices.

Update:

I have checked the admin panel and see that we have put * to Default Post Code in Stores->Configuration->Sales->Tax->Default Tax Destination Calculation

I think this is the reason why the * is displaying in the Postcode input field at the front-end. Now my question is, can I remove this * from the admin panel. Will it cause any issues because of removing *?

Could anyone please help me to resolve this issue?


texts:
In my the Magento2-0.74.0-beta7 there are some tables related to sales entities that start with sequence_.

sequence_creditmemo_0
sequence_creditmemo_1
sequence_invoice_0
sequence_invoice_1
sequence_order_0
sequence_order_1
sequence_shipment_0
sequence_shipment_1

All these tables contain a single column sequence_value

I assume that 0 and 1 at the end of the table name are related to the store id, but what's the purpose of the tables?


texts: How to find and delete products in magento that have no image

texts:
Can anyone help me find products that have no images assigned to them.

Either a list of products with no images or a way to delete them using a PHP script would be ideal

Thank you


texts:
I want to add an image to a template.

I've put the image in the /app/design/frontend/mycompany/mytheme/web/images folder.

Then I attempted several ways to try to reference/write the path in my template. After which I did System -> Cache Management -> Flush Static Files

Q1. Is that folder the correct place to put the image?
Q2. how do I refer to/write the path to the image in a phtml template?

I've obviously tried several variations to no avail. I also cannot find this information in the Frontend Developer's Guide.


texts: Changes not reflecting on mobile devices

texts:
Any changes which i do on my site are reflecting on desktop but not on mobile devices. why so.
The code changes are not at all reflecting on mobile devices


texts: Magento 2.3 Client Side less compilation static files not found

texts:
if I enable the Client side less compilation and flush the static file cache I will get 404 Errors for all files in the media and pub/static direction.
I'm using nginx.

If I compile the files manual with php bin/magento setup:static-content:deploy -f --theme Magento/backend en_US it works but the *.less files are not compiled after I change something and reload the side.

Did anyone have a solution for this?


texts: Send the form fields data from payment method step in the checkout Page to a model without saving data in the database

texts:
I am a beginner to Magento, I want to send the form fields data from payment method step in the onepage checkout Page to a model without saving data in the database.

Please find the below screenshot

Magento : 1.9.2.0

I want to get the data in the following file: app/code/community/PayUbiz/PayUbiz/Model/Standard.php with method name : getStandardCheckoutFormFields()


texts: I am new in Magento. Which files and folders should exclude while downloading a running Magento site to install in localhost ??


texts:
How do I better improve the performance of my search function in my Magento 2 website.

Every time i try searching a key word, such as Mi 8, it doesn't show results with the searched keyword in the title. Results such as Mi 8 pro & Mi 8 4+64GB should show up, but either no results shown or unrelated product listings were shown.

How do i get the search function to display related results for the users when they are searching, to show any listings that have the searched keyword. (Showing all the listings with the word 'Mi' when i search it)


texts: I need to place a block or image for bumdle product alone in magento?

texts:
I need to place a static block or image below the breadcrumbs in all bundle product pages.

How to achieve this.Help me with a solution?


texts:
I`m entering our online store datbase, for each item i have a unique item id and a almost unique bar code, the bar code may change with new new stock for example a bag of corn flakes 500 grams may have one barcode , after  6 months they may come up with new packaging with a new bar code.

so when i enter products into magento, for SKU will i use the bar code or SKU? if its SKU where do i use the barcode?

Thanks


texts: how to get virtual product data in product listing page and show in configurable product in magento 2?

texts:
I need to get all the child products details like id, name, sizes attribute from a configurable product id in a product listing page(list.phtml) page.

    <?php
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $product = $objectManager->get('Magento\Framework\Registry')->registry('current_product');//get current product
    $productTypeInstance = $product->getTypeInstance();
    $usedProducts = $productTypeInstance->getUsedProducts($product);

    //echo $product->getId(); //Main configurable product ID
    //echo $product->getName(); //Main Configurable Name

    foreach ($usedProducts  as $child) {
        echo $child->getSku()."</br>"; //Child Product Sku
    }

Above code is not working showing error Uncaught Error: Call to a member function getTypeInstance() on null

Please help me how to show virtual product information of configurable product in product listing page ?


texts: Get additional product attribute separately

texts:
How to get additional product attribute separately in the product view template?

$this->getAdditionalData() - is used in app/design/frontend/base/default/template/catalog/product/view/attributes.phtml.

It returns an array with all additional attributes.

I want to know if it is possible to get a single additional attribute, created by me in admin, without loading the whole array and having to do a foreach() .

Thanks!


texts: Magento 2.1 - Just (simply) call categories in PHTML

texts:
Before we could do something like this:

$_categories = Mage::helper('catalog/category')->getStoreCategories();
foreach($_categories as $_category):
    echo $_category->getName();
endforeach;

Plain and simple, just put it in a phtml file to list the categories. In Magento 2 it isn't as simple.

I've tried this, next to scrolling through 4 pages of Google searches for every possible solution ever. None of it works. I figure there is something wrong with my reasoning towards the new CMS. I probably need to see the logic in the structure of this code.

Can anyone please enlighten me on how to list all the stores categories in a phtml file like the example above?


texts:
I am migrating from Magento 1 to Magento 2

So, I have a few questions.

Since magento 2 has fundamental changes I assume that copying the extensions (files and folders) from magento 1 to magento 2 won't work?
Is there a way to check what extensions are installed in magento 1? (I received the project from another person)
When migrating the data I get the following errors. These are probably because of the missing extensions?

  [2016-03-07 16:24:03][ERROR]: Source documents are not mapped: find_feed_import_codes,googlebase_attributes,googlebase_items,googlebase_types,interaktingslider_slide,interaktingslider_slide_position,interaktingslider_slide_sto

  re,saferpaynew_api_debug,smtppro_email_log,ugiftcert_cert,ugiftcert_history

  [2016-03-07 16:24:03][ERROR]: Source fields are not mapped. Document: sales_flat_creditmemo. Fields:
  giftcert_amount,base_giftcert_amount

  [2016-03-07 16:24:03][ERROR]: Source fields are not mapped. Document:
  sales_flat_invoice. Fields: giftcert_amount,base_giftcert_amount

  [2016-03-07 16:24:03][ERROR]: Source fields are not mapped.
  Document: sales_flat_order. Fields:
  giftcert_code,giftcert_amount,base_giftcert_amount,giftcert_amount_invoiced,base_giftcert_amount_invoiced,giftcert_amount_credited,base_giftcert_amount_credited

  [2016-03-07 16:24:03][ERROR]: Source fields are not mapped.
  Document: sales_flat_quote. Fields: giftcert_code

  [2016-03-07 16:24:03][ERROR]: Source fields are not mapped.
  Document: sales_flat_quote_address. Fields:
  giftcert_amount,base_giftcert_amount,giftcert_code,base_giftcert_balances,giftcert_balances

Thanks for the help!

UPDATE 1

Thanks to RiccardoT and David Verholen. After updating the map.xml and config.xml The migrating is moving forward.

But now it is currently stuck at

EAV STep: [2016-03-08 12:38:36][ERROR]: Source and Destination attributes mismatch. Attribute id: 383

What does this error mean and how to fix it? I can't find the file to handle this error.


texts: How to add tracking ID link in shipping email?

texts:
I like to add tracking ID link for my shipping email template form.
Please advice me to do this process.


texts: get the Order Created Date in excel sheet

texts:
Background :

I tried below code to get order number in excel sheet, its working....

try{
    //configure the collection filters.
    $collection = Mage::getResourceModel('customer/customer_collection')
    ->addAttributeToSelect('entity_id')
    ->addAttributeToSelect('firstname')
    ->addAttributeToSelect('email');

    //Add a page size to the result set.
    $collection->setPageSize(50);
    //discover how many page the result will be.
    $pages = $collection->getLastPageNumber();
    $currentPage = 1;
    //This is the file to append the output to.
    $fp = fopen('customers.csv', 'w');
    $addedKeys = false;
    do{
         //Tell the collection which page to load.
         $collection->setCurPage($currentPage);
         $collection->load();
         foreach ($collection as $customer){
            $customerArray = $customer->toArray();

  $newordercollection = Mage::getModel("sales/order")->getCollection()->addFieldToFilter('customer_id',$customerArray['entity_id']);
  $collection->setOrder('entity_id', 'ASC');
  $firstItem = $newordercollection->getFirstItem();
  $orderID = $firstItem->getIncrementId();

            //write the collection array as a CSV.

            $customerREquiredArray['customer ID'] = $customerArray['entity_id'];
            $customerREquiredArray['First name'] = $customerArray['firstname'];
            $customerREquiredArray['Email'] = $customerArray['email'];
            $customerREquiredArray['order id']= $orderID;

Requirement & Issue :

Now i need  Order Created time , so i followed link & tried below code :

$orderdate = $firstItem->getCreatedAtStoreDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);

but got error as : No date part in '' found.

than i tried below one :

$orderdate = var_dump($newordercollection->getCreatedAt());

i got error as Fatal error: Uncaught Error: Call to undefined method Mage_Sales_Model_Resource_Order_Collection::getCreatedAt()


texts: How to show cache for product pagination collection page?

texts:
We have created custom category product collection having pagination, but when we add below code it's not working with pagination. When we click next page then it's always showing first page product.

<action method="setCacheLifetime">
   <lifetime>3600</lifetime>
</action>


texts:
I have a model called Warehouses and another called Warehouse Products which is associated. The issue I'm having is that Warehouse Products doesn't save, despite it's save() function  being wrapped in a try-catch which produces no issues.

try {
    $model->save();
    $session->addSuccess($this->__('The product has been saved.'));
    $this->_redirect('*/*/');

    return;
} catch (Mage_Core_Exception $e) {
    $session->addError($e->getMessage());
} catch (Exception $e) {
    $session->addError($this->__('An error occurred while saving this product.'));
}

If I use the model to return the table, I get the following:

$model->getResource()->getTable();
// Can't retrieve entity config

This obviously suggests there's something amiss with my setup -

<inventorymanagement>
    <class>CompanyName_InventoryManagement_Model</class>
    <resourceModel>inventorymanagement_resource</resourceModel>
</inventorymanagement>
<inventorymanagement_resource>
    <class>TheGenieLab_InventoryManagement_Model_Resource</class>
    <entities>
        <warehouse>

inventorymanagement_warehouse

        </warehouse>
        <warehouse_product>

inventorymanagement_warehouse_product

        </warehouse_product>
    </entities>
</inventorymanagement_resource>

The resources section:

<resources>
    <inventorymanagement_setup>
        <setup>
            <module>TheGenieLab_InventoryManagement</module>
        </setup>
    </inventorymanagement_setup>
</resources>

My files are laid out as below:

- Resource
    - Warehouse
        - Product
            - Collection.php
        - Collection.php
        - Product.php
    - Warehouse.php
- Warehouse
    - Product.php
- Warehouse.php

Is there something else I need to do?

EDIT

Here's some further code
Warehouse > Product.php

class CompanyName_InventoryManagement_Model_Warehouse_Product extends Mage_Core_Model_Abstract
{
    protected function _construct()
    {
        $this->_init('inventorymanagement/warehouse_product');
    }
}

Resource > Warehouse > Product.php

class CompanyName_InventoryManagement_Model_Resource_Warehouse_Product extends Mage_Core_Model_Mysql4_Abstract
{
    protected function _construct()
    {
        $this->_init('inventorymanagement/warehouse_product', 'id');
    }
}

Resource > Warehouse > Product > Collection.php

class CompanyName_InventoryManagement_Model_Resource_Warehouse_Product_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
{
    protected function _construct()
    {
        $this->_init('inventorymanagement/warehouse_product');
    }
}


texts:
I just created my first own module. It is a Block that should be shown on the cms home page. Later on I want to change this into a custom navigation bar that is present on all pages of my shop but for now I just want to see that it is working so far.So I followed this simple tutorial:http://magestore.com/magento-2-tutorial/magento-2-block-create-template-block/ Some things were unclear but I think I figured them out. Everything should work now but I can't see the message "Hello World" that my .php returns. Here is my setup of all files:

In app/code/Test/Navbar my folder structure looks like this:

├── Navbar
     ├── Block
         ├── Navbar.php
     ├── etc
         ├── module.xml
     ├── view
         ├── frontend
             ├── layout
                 ├── cms_index_index.xml
             ├── templates
                 ├── default
                     ├── navbar.phtml
     ├── registration.php

Here are the contents of my files:

registration.php

<?php
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/

\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'Test_Navigation',
__DIR__
);

Navbar.php

/**
* Room23 navigation bar
*/
class Navbar extends \Magento\Framework\View\Element\Template
{
public function getTitle()
{
return "Hello World";
}
}

module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
   <module name="Test_Navigation" setup_version="1.0.0"/>
</config>

cms_index_index.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">

<referenceContainer name="main">
<block class="Test\Navbar\Block\Navbar" template="default/navbar.phtml"/>
</referenceContainer>

</page>

navbar.phtml

<?php
/**
* Test navbar template
*
* @var $block TestNavbarBlockNavbar
*/
?>

<?php echo $block->getTitle(); ?>

I successfully enabled the module (I am running Magento 2 on a MAMP local server btw) and I don't get any errors. I read not only this but also other tutorials and they all tell me to do the same thing. But I don't see any results on my homepage. Why?


texts: Making smaller product item detail on category grid

texts:
New to MSE so hello everyone.

I was wondering if there is something that makes the product item description smaller on the category grid. Because its really long now and I need to increase it. I looked into similar questions and searched Google but couldn't find any answer. I thought my topic title is clear enough.

Anyway, is there a way to get it smaller, I took a look in attributes for product item but no possibility to change any of that. Maybe I'm just in the wrong direction. Please help.

Here a screenshot for it:

Thanks for any help.

Ciao, Hessel


texts:
Suppose color and price and manufacturer are three attribute codes.

black and blue are attribute values for color.
$0-100 and &101-200 are attribute values for price.
hp and dell are attribute values for price.

On category page, in filter section if I'm selecting attribute values black and &101-200. How can I get corresponding attribute codes?

In filter.phtml file sing this code I'm getting selected attribute code but not the attribute value in a proper format.

    <?php
$appliedFilters = Mage::getSingleton('catalog/layer')->getState()->getFilters();
foreach ($appliedFilters as $item) {
      $items[] = $item->getFilter()->getRequestVar();

}
foreach ($items as $item) {
     echo ($item."<br>");
   }


texts: Magento 1.9.3.6 Product Image uploaded but not save

texts: Suddenly My store stop to save product image. Product image uploaded successfully but not save and add in list. also radio button not selected. I dont know what is problem.


texts: How to add breadcrumbs in my account pages

texts:
I want to add Breadcrumbs in my account page & it should be displayed on every tab selection below the Navigation menu bar.

But it is not showing anything on my page it is looking like this

But when I am watching for the hints it is showing me like this

Which means breadcrumb is there but then why it is not showing there?
I want it to be shown like this

How could I get this to be done?


texts: SSL, Nginx, Varnish - Too many redirects

texts:
I know there are several questions on this issue, but no solutions seems to work for me.

I have Magento 1.9 running on Nginx port 8080 and with Varnish in front running on port 80. Without SSL it's working fine.
When I switch to SSL I do the following:

Change Varnish to run on port 6081 instead of 80 in /etc/default/varnish.
Add two Nginx server blocks, one for terminating SSL and one for redirecting 80 to 443.
Update web/secure/base_url and web/unsecure/base_url to use https:// (I do this directly in the database).

Things I've tried:

Setting web/secure/use_in_frontend to 1.
Adding "SetEnvIf X-Forwarded-Proto https HTTPS=on" to .htaccess (didn't have a htaccess so created one).

Nginx conf with SSL activated (2 top server blocks):

server {
  listen 80;
  server_name www.domain.com domain.com;
  return 301 https://$host$request_uri;
}

server {
  listen 443 ssl;
  server_name www.domain.com domain.com;
  ssl on;
  ssl_certificate /etc/nginx/ssl/www_domain_se/ssl-bundle.crt;
  ssl_certificate_key /etc/nginx/ssl/www_domain_se/myserver.key;
  ssl_protocols              TLSv1 TLSv1.1 TLSv1.2;
  ssl_ciphers               'AES128+EECDH:AES128+EDH:!aNULL';
  keepalive_timeout 300s;
  location / {
     proxy_pass http://127.0.0.1:6081;
     proxy_set_header X-Real-IP  $remote_addr;
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     proxy_set_header X-Forwarded-Proto https;
     proxy_set_header X-Forwarded-Port 443;
     proxy_set_header Host $host;
  }
}

server {
    listen 8080;
    server_name www.domain.com domain.com;
    root /var/www/domain;

    location / {
        index index.html index.php;
        try_files $uri $uri/ @handler;
        expires 30d;
    }

    location ^~ /app/                { deny all; }
    location ^~ /includes/           { deny all; }
    location ^~ /lib/                { deny all; }
    location ^~ /media/downloadable/ { deny all; }
    location ^~ /pkginfo/            { deny all; }
    location ^~ /report/config.xml   { deny all; }
    location ^~ /var/                { deny all; }

    location /var/export/ {
        auth_basic           "Restricted";
        auth_basic_user_file htpasswd;
        autoindex            on;
    }

    location @handler {
        rewrite / /index.php;
    }

    location ~ .php/ {
        rewrite ^(.*.php)/ $1 last;
    }

    location ~ .php$ {
        if (!-e $request_filename) { rewrite / /index.php last; }
        expires        off;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        fastcgi_param  MAGE_RUN_CODE default;
        fastcgi_param  MAGE_RUN_TYPE store;
        fastcgi_read_timeout 300;
        fastcgi_param  HTTPS on;
        include        fastcgi_params;
    }
}

Here's /etc/varnish/default.vcl:

vcl 4.0;

# Default backend definition. Set this to point to your content server.
backend default {
    .host = "127.0.0.1";
    .port = "8080";
    .first_byte_timeout = 300s;
}

sub vcl_recv {
    if (req.method == "PURGE") {
            return (purge);
     }
}

sub vcl_backend_response {
    # Happens after we have read the response headers from the backend.
    #
    # Here you clean the response headers, removing silly Set-Cookie headers
    # and other mistakes your backend does.
}

sub vcl_deliver {
    # Happens when we have all the pieces we need, and are about to send the
    # response to the client.
    #
    # You can do accounting or modifying the final object here.
}

And /etc/default/varnish:

START=yes

NFILES=131072

MEMLOCK=82000

 DAEMON_OPTS=" -a :6081 \
               -T localhost:6082 \
               -f /etc/varnish/default.vcl \
               -S /etc/varnish/secret \
               -p feature=+esi_ignore_other_elements \
               -p cli_buffer=16384 \
               -p vcc_allow_inline_c=on \
               -s malloc,256m"


texts: Resource (HTML theme)for learning Magento 2 theme integration

texts:
Where i can find the Magento 2 THEME (HTML) not the completed developed theme.

I want to learn Magento 2 theme integration.
By THEME i mean to say a collection of simple html pages like home(index.html) , listing, detail, checkout etc...using those i want to develop the original magento pages.

Thanks in advance


texts: how do you call Blocks in Controller Magento2?

texts:
I want getBlock Adb/Block/Index in controller Adb/Controller/Category/View. So How do it?

Edit

in controller.

namespace Addon\Faq\Controller\Category;

class View extends \Addon\Faq\Controller\Category
{
    /**
     * @var \Magento\Framework\Controller\Result\ForwardFactory
     */
    protected $_coreRegistry = null;
    /**
     * @var \Magento\Framework\View\Result\PageFactory
     */
    protected $resultPageFactory ;

    /**
     * @param \Magento\Backend\App\Action\Context $context
     * @param \Magento\Framework\View\Result\PageFactory $resultPageFactory
     */
    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $resultPageFactory,
        \Magento\Framework\Registry $registry

    ) {
        $this->resultPageFactory  = $resultPageFactory;
        $this->_coreRegistry = $registry;
        parent::__construct($context);
    }

    /**
     * Product list page
     *
     * @return \Magento\Backend\Model\View\Result\Page
     */
    public function execute()
    {
        $resultPage = $this->resultPageFactory ->create();
        $blockInstance = $resultPage->getLayout()->getBlock('category.index');

    }
}

layout in frontend

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <block class="Addon\Faq\Block\Faq" name="category.index" template="Addon_Faq::view.phtml"/>
        </referenceContainer>
    </body>
</page>

It not call block Faq


texts:
It seems when i debug my custom layout, it is not getting called!

UPDATED ANS:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="3columns" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
    <action method="setTitle">
        <argument name="title" xsi:type="string">My Title</argument>
    </action>
</head>
<body>
    <reference name="root">
        <action method="setTemplate">
            <argument name="template" xsi:type="string">Vendor_Module::page/3columns.phtml</argument>
        </action>
    </reference>
    <referenceContainer name="left">
        <!-- <block class="Vendor\Module\Block\Filter" name="custom_filter" before="-"/> -->
        <block class="Vendor\Module\Block\Navigation" name="custom_filter" before="-"/>
    </referenceContainer>
    <referenceContainer name="content">
        <block template="Vendor\Module::product/list.phtml" class="Magento\Catalog\Block\Product\ListProduct" name="product_list">
            <block template="Vendor\Module::toolbar.phtml" class="Magento\Catalog\Block\Product\ProductList\Toolbar" name="product_list_toolbar">
                <block class="Magento\Theme\Block\Html\Pager" name="product_list_toolbar_pager"/>
            </block>
            <action method="setToolbarBlockName">
                <argument name="name" xsi:type="string">product_list_toolbar</argument>
            </action>
        </block>
    </referenceContainer>
</body>
</page>

So when i hit the localhost/magento/m/result/index If my layout file is rendered, i should get the file in my custom debug file which logs the layout called.

Controller path: Controller/Result/Index.php

layout file: mypage_result_index.php

router :   route id="mypage" frontName="m"


texts: How to print order attachment along with the invoice

texts:
Can you tell me how I can print all custom attributes an order has programatically?
and the file to edit the code, I have tried object manager, sales


texts: How can I pull the order value of a sale from Magento Go?

texts:
I am using Mangento Go and after a sale has taken place on the confirmation page I am using a JS code that needs the value of the sale in a variable like $totalvalue.

I am unable to find something in the templates to grab that value and put it into a variable.  ANy ideas on how I can do this? I am new to Magento so very lost.  Please let me know if there is a way.  Thanks!

I found this page: http://go.magento.com/support/kb/entry/name/defining-transactional-variables/

But they are referring to transactional emails but i need this on the sales confirmation page.


texts: Filter a product block collection by custom attribute

texts:
I extended Mage_Catalog_Block_Product_List's _getProductCollection() previously to return 6 random products to display on the home page. This code was working fine.

$this->setCategoryId(40);
$category = new Mage_Catalog_Model_Category();
$category->load($this->getCategoryId());
$collection = $category->getProductCollection();
$collection->getSelect()->order('rand()');
$collection->getSelect()->limit(6);
$collection->addStoreFilter();

Mage::getModel('catalog/layer')->prepareProductCollection($collection);
$collection->load();

I added a custom product attribute and updated the code to:

$collection = Mage::getModel('catalog/category')->load(4)
    ->getProductCollection()
    ->addAttributeToSelect('*')
    ->addAttributeToFilter('cc_featured', array('eq' => true));
$collection->getSelect()->limit(6);
$collection->addStoreFilter();

Where 4 is my root category. However this returns no results. I debugged the SQL and the problem appears to be this condition cat_index.is_parent=1.

I am not sure if I am going about this right and need some guidance. I have tried answers to similar questions, at best it will find 6 products, but it is missing all the product detail (price, image, etc)


texts: Error when add product to cart in magento 1

texts:
I installed a module ajax add to cart and when click add to cart, it show error

Refused to execute script from 'http://.../ajaxcartsuper/ajaxcart/delete/id/...' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

I saw it in the head.phtml file

<meta http-equiv="Content-Type" content="<?php echo $this->getContentType() ?>" />

But i cann't fix it, please help me.


texts: Retaining last_visit_at while cleaning logs

texts:
My log_ tables are beginning to grow rather large, and I'm trying to clean up the database. I'm sure this would be easy for most, however, my website uses the "last_visit_at" column of log_customer in order to show when a user was last active. What would be the best way of going about cleaning these tables without resetting everyone's last activity? If even possible?

By last activity, I do not mean last login.

I have already attempted to truncate log_url and log_url_info thinking that it wouldn't effect the last_visit_at from log_visitor, but apparently it does?

I'm thinking, I could grab their last activity how I do now:

$logCustomer = Mage::getModel('log/customer')->loadByCustomer($customer)->getLastVisitAt();

and if it's NULL, then simply grab their last login which would still be saved. But I'd really love to continue using their last activity.


texts: Magento2 : Overriding Model file not working

texts:
I want to override Magento\Payment\Model\Info::setAdditionalInformation() function my code is as below

<preference for="Magento\Payment\Model\Info" type="Xxx\Yyy\Model\Payment\Info" />

and file is app\code\Xxx\Yyy\Model\Payment\Info.php

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Xxx\Yyy\Model\Payment;

/**
 * Payment information model
 *
 * @api
 * @since 100.0.2
 */
class Info extends \Magento\Payment\Model\Info
{
    /**
     * Additional information container
     *
     * @var array
     */
    protected $_additionalInformation = [];

/**
 * @param \Magento\Framework\Model\Context $context
 * @param array $data
 */
public function __construct(
    \Magento\Framework\Model\Context $context,
    \Magento\Framework\Registry $registry,
    \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory,
    \Magento\Framework\Api\AttributeValueFactory $customAttributeFactory,
    \Magento\Payment\Helper\Data $paymentData,
    \Magento\Framework\Encryption\EncryptorInterface $encryptor,
    \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
    \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
    array $data = []
) {
    parent::__construct(
        $context,
        $registry,
        $extensionFactory,
        $customAttributeFactory,
        $paymentData,
        $encryptor,
        $resource,
        $$resourceCollection,
        $data
    );
}

public function setAdditionalInformation($key, $value = null)
{
    if (is_object($value)) {
        throw new \Magento\Framework\Exception\LocalizedException(__('The payment disallows storing object XXXXXXXXXXXX'));
    }

    $this->_initAdditionalInformation();
    if (is_array($key) && $value === null) {
        $this->_additionalInformation = $key;
    } else {
        $this->_additionalInformation[$key] = $value;
    }
    return $this->setData('additional_information', $this->_additionalInformation);
}

}

When I compiled not getting any error,but unfortunately I cant override this function.
EDIT
my di.xml file code

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Advanced" type="Tecksky\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Advanced" />
    <preference for="Magento\Catalog\Helper\Product\Compare" type="Xxx\Yyy\Helper\Product\Compare" />
    <preference for="Magento\Catalog\CustomerData\CompareProducts" type="Xxx\Yyy\CustomerData\CompareProducts" />
    <preference for="Magento\Customer\Block\Account\Customer" type="Xxx\Yyy\Block\Account\Customer" />

    <preference for="Magento\CatalogSearch\Controller\Advanced\Index" type="Xxx\Yyy\Controller\CatalogSearch" />
    <preference for="Magento\Search\Controller\Term\Popular" type="Xxx\Yyy\Controller\Searchterm" />
    <preference for="Magento\Sales\Controller\Guest\Form" type="Xxx\Yyy\Controller\Guestform" />
    <preference for="Magento\Payment\Model\Info" type="Xxx\Yyy\Model\Payment\Info" />

    <type name="Magento\Framework\View\Result\Page">
        <plugin name="addBodyclass" type="Xxx\Yyy\Plugin\Result\Page"/>
    </type>
    <type name="Magento\Checkout\Block\Checkout\LayoutProcessor">
        <plugin name="ts_checkout_layout_processor" type="Xxx\Yyy\Plugin\Block\LayoutProcessor" sortOrder="1"/>
    </type>
    <type name="Magento\Framework\Api\DataObjectHelper">
        <plugin name="checkout_cart_total_ajax_error" type="Xxx\Yyy\Plugin\Framework\Api\DataObjectHelper" sortOrder="100" disabled="false"/>
    </type>
</config>


texts: How to deal with API integrations and deployment when developing locally for magento?

texts:
I'm trying to set up a nice development environment for magento. Naturally, I also try to take deployment into consideration. This is why I chose to implement docker containers. My project is very small, nonetheless, I find it a good investment learning how to deal with containers.
PHPStorm - or any IDE really - needs fast access to files in order to function properly. As far as I know, this means that the magento installation at least during development needs to be stored locally.
The problem that I have right now is that the web shop I'm building receives API requests from an ERP. Naturally, the DNS points to the production server. This leads me to my first question:
How do I deal with API integrations when developing locally?
First thing that crossed my mind was perhaps setting up an API proxy of some kind. But it might also be that case that I should be approaching magento development differently. Judging by the fact that magento has a built-in development mode, perhaps I'm not supposed to have two copies of the installation, one locally and another one in the production server.
Thinking a little bit ahead, another problem that will arise if I continue developing locally is e.g. that my database will probably differ from that of the production server, although I must stay I'm not sure how much of the website settings etc magento persists through the database. More specifically, at some point I will attempt to develop PWAs for existing web shops using magento PWA studio. Leading to my second question:
Developing locally for a magento installation already in production, how do I guarantee successful deployment when I'm done developing?


texts:
I have a question.

Magento need cron job? if i remove cron can it work normally?

Because cron make our site so slowly. we already setting 1 hour delete from cron_schedule.

Thank you!


texts:
I would like to filter on a custom attribute all product collection. I tried to use the catalog_product_collection_load_after event but I can't filter collection as it's already loaded here.

The event catalog_product_collection_load_before does not exist. Is there any solution to do this ?

Here's the code I tried :

<event name="catalog_product_collection_load_after">
    <observer name="plugin" instance="Vendor\Module\Observer\ProductCollection" />
</event>

Observer.php

public function execute(Observer $observer)
{
    $observer->getCollection()->addFieldToFilter('attribute', ['lteq' => "xx"]);

    return $this;
}


texts:
Are magento translations managed through: app/locale/language_name, or app/design/frontend/default/My_themename/locale

Are there any priorities if they wxist in both places?

Can someone clearify this to me?

Thanks


texts: Magento 2.3 Configuration Product Show No Associated Products After Migration

texts:
I tried to migrate producs from magento 1.9.3 to magento 2.3, everything is okay until I check the configurable product. Then I found associated product on the configurable product is null but the simple product is already migrated like this below screenshot:

So how I can migrated the links of configurable with associated product too. If someone already have same issue and solved it, please advise.

update :

here is my catalog_product_super_link table it the relation data has been migrated, but it not applied on the website product


texts: Chaning the behavior of {{layout handle="" order=$order}}

texts:
Background information:

In app/locale/country_code/email/sales/order_new.html you can edit the template which is used as an order confirmation.

Inside the order_new.html I have this code:

{{layout handle="sales_email_order_items" order=$order}}

What I need to do:
I need to edit the behavior of that specific layout. Where can I do this?


texts:
I want to prevent a customer to login multiple times from different machines. When a customer tries to login I want to logout customer logout from all other machines.

How can I logout customer from all previous machines?


texts: PHP Fatal error: Uncaught exception CredisException?

texts:
We are getting these errors from time to time, and we have no idea what causing them.

We are using:

Magento 1.9.3.3
PHP 5.6.30
Redis 3.2.9

Error in logs

PHP Fatal error:  Uncaught exception 'CredisException' with message
'Read operation timed out.' in /multistore/lib/Credis/Client.php:1042
Stack trace:
#0 /multistore/lib/Credis/Client.php(825): Credis_Client->read_reply('select')
#1 /multistore/lib/Credis/Client.php(599): Credis_Client->__call('select', Array)
#2 /multistore/lib/Cm/Cache/Backend/Redis.php(135): Credis_Client->select(2)
#3 /multistore/lib/Zend/Cache.php(153): Cm_Cache_Backend_Redis->__construct(Array)
#4 /multistore/lib/Zend/Cache.php(94): Zend_Cache::_makeBackend('Cm_Cache_Backen...', Array, true, true)
#5 /multistore/app/code/core/Mage/Core/Model/Cache.php(137): Zend_Cache::factory('Varien_Cache_Co...', 'Cm_Cache_Backen...', Array, Array, true, true, true)
#6 /multistore in /multistore/lib/Credis/Client.php on line 1042


texts:
I am wondering whether I should start my store with Magento. The case is that I will want to offer step by step process (around 12 different product categories, from which user will have to pick one of each). This means, that the scenario will be as following: User sees step 1, needs to select 1 product from step 1 products, then goes to step 2, where he needs to select 1 product from step 2 products, etc. On top of that, at the very beginning, he will have to pick city, to determine the prices.

Could magento handle this?


texts: Add product name in product view within a new phtml?

texts:
I copied catalog_product_view.xml and pasted it into app\design\frontend\Mytheme\DreamShop\Magento_Catalog\layout folder and code is added before the default.phtml

<block class="Magento\Catalog\Block\Product\View" name="product.info.options.productname" as="productname" template="Magento_Catalog::product/view/options/productname.phtml"/>


texts: Running Magento 2's Provided Code Sniffs

texts: Magento 2 seems to include a set of PHP code sniffs in the source repository.  How can I, as a third party developer, use the phpcs tool to run these sniffs against my code?


texts: How can I add a page layout to Mage_Page module?

texts:
I discovered after upgrading Magento that the core Mage_Page's config.xml had been manually edited, and now I'm looking to change the XML in a way that doesn't overwrite core.

Here is an example of the core XML:

<config>
    <modules>
        <Mage_Page>
            <version>1.6.0.0</version>
        </Mage_Page>
    </modules>
    <global>
        <models>
            <page>
                <class>Mage_Page_Model</class>
            </page>
        </models>
        <blocks>
            <page>
                <class>Mage_Page_Block</class>
            </page>
        </blocks>
        <page>
            <layouts>
                <empty module="page" translate="label">
                    Empty
                    <template>page/empty.phtml</template>
                    <layout_handle>page_empty</layout_handle>
                </empty>
                <one_column module="page" translate="label">
                    1 column
                    <template>page/1column.phtml</template>
                    <layout_handle>page_one_column</layout_handle>
                    <is_default>1</is_default>

I'm looking to add another layout, like one_column or empty. Overwriting config.xml with app/code/local/Mage/Page/etc/config.xml didn't seem to work, how should I go about doing it without touching core?


texts: all the category urls doesn't work. i get 404 error code

texts:
my system: Magento 2
website: https://homconcept.co.uk/

I don't see any category, and all the category doesn't work.

I tried reindex and clean cache.
but did not work.

https://homconcept.co.uk/catalog/category/view/id/2/
https://homconcept.co.uk/sofas.html
https://homconcept.co.uk/sofas/

none of them work.

can you help me, please?


texts: Custom Sorting for Product collection based on position, best seller and product created date

texts:
I have to implement following scenario.

Add one new sort option named as New & Best Selling. When sort by this option it should follow below rule:

display the product which has position greater than 1
product based on best seller in descending order
remaining product based on it's created date in descending order.

Can anyone please guide me ?


texts: Magento1 - Create attribute type "Table"

texts:
I need in Magento1 to be able to add "table" type attributes. Each attribute created must have an "add line" button so that each product has its own characteristics.
ES. attribute "color" : in the product "sku-1" it will have the lines "red" "yellow" "green" and in the product "sku-2" It will have lines "red" "orange" "black" "white".
I would have to create several "table" attributes and each will have different columns. Is there any way to do this?
Thanks so much


texts: Magento 2.4: Catalog Search index exception: Could not ping search engine: No alive nodes found in your cluster

texts:
We have installed Magento 2.4 on our local machine. After installing, we have got the below error when doing the setup:upgrade

Could not validate a connection to Elasticsearch. No alive nodes found
in your cluster

So we have disabled the elastic search module via config.php. After disabling the elastic search, we can successfully upgrade and run the deployment without any issues.
However, we are not able to create a product in admin as its keep loading and getting the below error in console.

We have try reindex but the below indexer is not running.

Catalog Search index exception: Could not ping search engine: No alive
nodes found in your cluster

Please help me to resolve this issue.


texts: Magento looks for my custom local module under namespace Mage

texts:
I've created a custom module with an Observer to log every product change on a log file.
The Observer is listening on the event catalog_product_save_after.
I've created the folder for my namespace under app/code/local and so I defined it on the configuration files.

My problem is that Magento is trying to load the module under the namespace Mage, and I don't know the reason for this behavior.

Here are the error log:

  2018-01-05T09:06:51+00:00 ERR (3): Warning: include(Mage/Mynamespace/Editlog/Model/Observer.php): failed to open stream: No such file or directory  in /Applications/MAMP/htdocs/magento/lib/Varien/Autoload.php on line 94

  2018-01-05T09:06:51+00:00 ERR (3): Warning: include(): Failed opening 'Mage/Mynamespace/Editlog/Model/Observer.php' for inclusion (include_path='/Applications/MAMP/htdocs/magento/app/code/local:/Applications/MAMP/htdocs/magento/app/code/community:/Applications/MAMP/htdocs/magento/app/code/core:/Applications/MAMP/htdocs/magento/lib:.:/Applications/MAMP/bin/php/php7.1.8/lib/php')  in /Applications/MAMP/htdocs/magento/lib/Varien/Autoload.php on line 94

Does anyone know why is looking for the observer under the Mage directory ?
Do I have to put there my module?


texts:
I'm receiving this error:
Catalog Search index exception: Type Error occurred when creating object: Magento\Search\Model\EngineResolver, Argument 2 passed to Magento\Search\Model\EngineResolver::__construct() must be of the type array, null given, called in /var/www/html/shop/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 121

When I run the command
php bin/magento indexer:reindex
Any ideas?
Edit:
OS: Ubuntu 18.04
Magento: 2.4.1


texts: Bulk upload weight to products in Magento 2

texts:
Is it possible to bulk upload 'weight' to existing products in Magento 2?
I have a list of 1200 products on Magneto which are live on my site but would like to bulk add their individual weight without going through and doing this manually.
Is this possible? We are currently using Magento Version 2.3.5.
Thank you for your help.


texts:
Can someone explain to me why I need Oauth to query a list of products for a guest?

I don't understand, I just want a JSON of the product properties for my JavaScript, why do I need this Oauth procedure when dealing with the Rest API?

Or should I just echo out the models contents in json_encode() and do it that way?

Thank you


texts:
It seems that by default Magento does not cache the majority of blocks.
I'm comfortable extending blocks and applying my own cache settings, but it seems odd that I would have to do this for the majority of everything.
Am I missing something or does it really take this much customization to really get the benefits of block level caching in Magento?


texts: how to repeat failed transaction - pay button, request payment etc

texts:
are there any options to repeat failed transaction (user didn't complete payment, something interrupted, client accidentally closed browser).
In Magento I cannot see related option - any button Pay Now,
or email trigerred to customer with request to pay again.

I see only Reorder again, but this is not the same.
The same option would be important if admin creates backorder - and what then ?
How to request user to pay for backorder - via Paypal or other payment gateways

Do you know any options for it ? Any payment gate for Europe merchants that supports
this case ?

Thanks
Tomek
http://www.shopmages.com


texts: Magento 2 .gitignore template for new project

texts:
I've installed magento2 via composer. I couldn't find any information about common gitignore files for magento2 and the the file structure is still strange to me.

Can someone share a common gitignore template? Thanks!


texts: New Mailchimp Extension - Missing Webhook in List

texts:
I've followed Mailchimp's steps to uninstall the old MageMonkey extension and install their new version. In doing so, they say to remove all old webhooks as the new extension does not work with them.

Now that I've done that, no new webhook is being created and I don't understand how to properly setup this Callback URL/Webhook.

Is there a format to follow? Any area where I can find my "key"? Any help is appreciated!


texts:
We have configured a new account with UPS with Magento 1.7 CE

We got all the settings, access codes and etc entered:

Negotiated rates are showing up no problem, but when trying to create a label we get "SAMPLE" on the label.

This is confusing because the configuration is clearly set to LIVE rates.

I have been on email tag with UPS API support and have not gotten a clear message. They say to replace ONE of the urls in the settings to https://onlinetools.ups.com/ups.app/xml/XAV - which after trying doesnt pull up any UPS rates at all.

It doesn't also change anything about the "SAMPLE" problem - even after re-creating the label and deleting the old one it still shows "SAMPLE" on them.

Do I need to do some kind of label certification like Fedex? I dont see this anywhere in the manuals for UPS api and support has not answered that question either.

Any ideas?


texts:
Trying to setup a Configurable Product.

Up to my fifth listing for different colours in the one listing. The latest listing which has variations of Storage Size;(16GB, 32GB, 64GB) and Colour; (Black, White, Pink, Merlot Red, Rose Gold Black, Rose Gold White)

I get this error when clicking on "
Generate combinations of Simple Products" button;

  Auto Generate Simple Products SQLSTATE[23000]: Integrity constraint
  violation: 1062 Duplicate entry '1061-1060' for key
  'UNQ_CATALOG_PRODUCT_SUPER_LINK_PRODUCT_ID_PARENT_ID', query was:
  INSERT INTO catalog_product_super_link (product_id,parent_id)
  VALUES (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?),
  (?, ?), (?, ?)

Worked with the other four listings, but they had much smaller sizes and colours. Anybody know anything I can do?

This is from an addon called Simple Products Generator

EDIT: It seems to be any variation of sizes/colours, it will not write into the database anymore I'm guessing? I've tried one size & one colour and the same error comes up.

EDIT2: It managed to pass the "Processing" with One colour 3 sizes, but after it finishes and you click "Close" the drop down menu products it creates do not show up on the Associated Products page. But if I have a look into Manage Products the pages are definitely created. Just not linked to the Original Listing.

Thanks, Steve


texts:
When I generate static files in the deployment, I run
php bin/magento setup:static-content:deploy but it fails.
 I have disabled the extension=php_intl.dll
 in etc/php/7.0/cli/php.ini and restarted the apache webserver, but the issue is still popping up.

  jordan@jordan-Precision-M4600:/var/www/html/lightrabbit2$ php
  bin/magento setup:static-content:deploy

  PHP Warning:  PHP Startup: Unable to load dynamic library
  '/usr/lib/php/20151012/php_intl.dll' -
  /usr/lib/php/20151012/php_intl.dll: cannot open shared object file: No
  such file or directory in Unknown on line 0 cache_dir
  "/var/www/html/lightrabbit2/var/page_cache" is not writable
  jordan@jordan-Precision-M4600:/var/www/html/lightrabbit2$


texts: Implimenting Custom Controller with payment option issues

texts:
I'm hoping someone can contribute to my complex issue. We have implemented a custom registration form with the aim of enrolling 'consultants'. Part of this enrollment is to order a special starter product (required). I have implemented a new module and front-end controller to process this request.

Now, I would like to add the payment methods block to my form. so that said user can complete their payment on the same form as their reg details, the registration order is compulsory so doing it the other way around (register customer, create cart, send to checkout) is not going to work, the new user can abort on the checkout, or even go back and add other catalogue items to the order!

So my question in a nutshell is "Can I implement a payment solution on my own front end form??".

In more detail I'd like the user to (1) choose their payment method (derived from Magento's set up payment solutions) then (2) validate this with the registration and (3) process the payment. If all goes well then (4) confirm order and registration.

I'm an advanced programmer and have a good grasp of MVC, however some of Magento's mysticism still illude me! The standard payment/form doesn't work as it requires a logged in user, otherwise just shows a registration form, however If I can inherit, overload or otherwise hack into this and re-use it for my purposes that would be the winning answer!

So:

How do I implement my own payment options block on my custom form?
After creating the quote/order how do I tell Magento programmatically to 'take payment with details supplied' and handle the response?

Any and all help most welcome! I've burnt some hours trying to achieve this already!

Thanks in advance!

Danny 'Blatant'
Lead Developer @ Cygnus


texts: Remove or disable customer attribute added from migration from 1.9.3.2 to 2.1.4

texts:
I have migrated a site from 1.9.3.2 to 2.1.4 and there is a customer attribute customerno that was added from a module called Fontis_Customer. The old module has a file:

app/code/local/Fontis/Customer/Model/Entity/Setup.php

class Fontis_Customer_Model_Entity_Setup extends Mage_Customer_Model_Entity_Setup
{
        'customerno' => array(
                'label'         => 'Customer Number',
                'visible'       => true,
                'required'      => true,
        ),
}

After migration it carried this attribute over and is preventing checkouts. When I click the button to checkout I get the error message The value of attribute "customerno" must be set I ran a query:

mysql> select * from eav_attribute ea INNER JOIN customer_eav_attribute cea ON cea.attribute_id = ea.attribute_id WHERE ea.frontend_label LIKE '%Customer%' \G
*************************** 1. row ***************************
         attribute_id: 140
       entity_type_id: 1
       attribute_code: customerno
      attribute_model: NULL
        backend_model: NULL
         backend_type: varchar
        backend_table: NULL
       frontend_model: NULL
       frontend_input: text
       frontend_label: Customer Number
       frontend_class: NULL
         source_model: NULL
          is_required: 0
      is_user_defined: 0
        default_value: NULL
            is_unique: 0
                 note: NULL
         attribute_id: 140
           is_visible: 1
         input_filter: NULL
      multiline_count: 1
       validate_rules: NULL
            is_system: 0
           sort_order: 0
           data_model: NULL
      is_used_in_grid: 0
   is_visible_in_grid: 0
is_filterable_in_grid: 0
is_searchable_in_grid: 0

and I saw that the field is_required was set to 1. I set it to 0 thinking that would solve the problem but it doesn't. Is there somewhere else that this value is set to required in the database?

EDIT: I should note that I would prefer to do it at the database level instead of creating a module to do it for me.


texts:
I wanted orders collection by shipping region id. What I have done:

$order = Mage::getModel('sales/order')->getCollection()->getLastItem();
print_r($order->getData());

When I do print_r the order data, so region_id is not accessible otherwise I would have used addAttributeToFilter() or addFieldToFilter().

region_id is accessible on the print_r($order->getShippingAddress()->getData());

How can I add region_id in the filter?

Edited

I want something like this

Mage::getModel('sales/order')->getCollection()->addFieldToFilter('region_id',517)

all orders whose shipping region id is 517.


texts: Do bound parameters get escaped using the Core/Resource model?

texts:
Consider the following example:

$connection = Mage::getSingleton('core/resource')->getConnection('core_read');
$email_address = $_GET['email'];

$sql = 'SELECT * FROM `foo` WHERE `email_address` = ?';
$bar = $connection->fetchAll($sql, $email_address);

Does Magento handle escaping automatically, based on the bound parameters — or would this code be susceptible to SQL injection?

Source: How to mysql escape in magento?

  I think Magento uses a DB Access layer based on PDO, which handles escaping automatically provided you use bound parameters.

When looking at Mage_Core_Model_Resource, the getConnection method states:

/**
 * Creates a connection to resource whenever needed
 *
 * @param string $name
 * @return Varien_Db_Adapter_Interface
 */

When looking at lib/Varien/Db/Adapter/Interface.php, the following comment is visible for the fetchOne method:

 /**
 * Safely quotes a value for an SQL statement.
 *
 * If an array is passed as the value, the array values are quoted
 * and then returned as a comma-separated string.
 *
 * @param mixed $value The value to quote.
 * @param mixed $type  OPTIONAL the SQL datatype name, or constant, or null.
 * @return mixed An SQL-safe quoted value (or string of separated values).
 */

This seems to imply that the parameters are safely escaped. The same comments aren't visible on the other fetch methods (i.e fetchRow, fetchAll etc).

Thus, would parsing user input values into the SQL statement using the fetchOne, fetchRow, fetchAll methods be susceptible to SQL injection — or would the parameters be safely escaped by the Variant Interface?


texts: Not getting Specific field value using Get method even its exists in collection and also in collection getData magento 2

texts:
This is my code:

$collection = $this->_productCollectionFactory->create()

$collection->addAttributeToSelect('*')->load();

I am Not getting Specific field value using Get method even its exists in collection query and also in collection array of getData() magento 2.

+----------+------+
| qty| get_type   |
+----+------------+
| 12 |  simple    |
+----+------------+
| 62 |configurable|
+-----------------+

Note : It contains some JOIN's but i am not getting some fields in $collection $data->getTypeId() in foreach


texts: Insert product to database by PHP doesnt work, products do not appear

texts: would you please provide a simple way to add a basic product with no image and no options and nothing, just a simple product that is inserted by PHP to the database AND appears in both front and backend. Version is 19.0.1. Thank you


texts:
I'm running Magento 1.7 and am looking to set up a Cronjob (Very little experience with this) to export my sales orders every 30min and place them in a folder on my desktop.

I only know how to manually export through Magento's Admin Panel.


texts:
I am getting an error that seems to happen randomly when trying to login to Magento backend. Even when I do gain access to backend without error, it takes a very long time.

Any idea what this error is caused by?

a:5:{i:0;s:63:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away";i:1;s:2692:"#0 /home/website/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/website/public_html/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /home/website/public_html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#3 /home/website/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `admin_r...', Array)
#4 /home/website/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `admin_r...', Array)
#5 /home/website/public_html/lib/Zend/Db/Adapter/Abstract.php(734): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
#6 /home/website/public_html/app/code/core/Mage/Admin/Model/Resource/Acl.php(69): Zend_Db_Adapter_Abstract->fetchAll(Object(Varien_Db_Select))
#7 /home/website/public_html/app/code/core/Mage/Admin/Model/Session.php(100): Mage_Admin_Model_Resource_Acl->loadAcl()
#8 /home/website/public_html/app/code/core/Mage/Admin/Model/Observer.php(69): Mage_Admin_Model_Session->login('login_name', 'password', Object(Mage_Core_Controller_Request_Http))
#9 /home/website/public_html/app/code/core/Mage/Core/Model/App.php(1338): Mage_Admin_Model_Observer->actionPreDispatchAdmin(Object(Varien_Event_Observer))
#10 /home/website/public_html/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Admin_Model_Observer), 'actionPreDispat...', Object(Varien_Event_Observer))
#11 /home/website/public_html/app/Mage.php(447): Mage_Core_Model_App->dispatchEvent('controller_acti...', Array)
#12 /home/website/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(528): Mage::dispatchEvent('controller_acti...', Array)
#13 /home/website/public_html/app/code/core/Mage/Adminhtml/Controller/Action.php(160): Mage_Core_Controller_Varien_Action->preDispatch()
#14 /home/website/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(408): Mage_Adminhtml_Controller_Action->preDispatch()
#15 /home/website/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#16 /home/website/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#17 /home/website/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#18 /home/website/public_html/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#19 /home/website/public_html/index.php(88): Mage::run('', 'store')
#20 {main}";s:3:"url";s:16:"/index.php/admin";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:5:"admin";}


texts: Please Correct The Country Code error when viewing customer data

texts:
I keep getting this error in Magento 2.3.1 when viewing some customer address data in Customers > view customer > Addresses
"Something went wrong with processing the default view and we have restored the filter to its original state."

The error doesn't appear if the customer has not got an address saved.

Digging in to the exception.log file I see this error:

  main.CRITICAL: Please correct the country code: . {"exception":"[object] (Magento\Framework\Exception\LocalizedException(code: 0): Please correct the country code: . at /var/www/magento/vendor/magento/module-directory/Model/ResourceModel/Country.php:46)"} []

It happens on all new customer accounts whether they've registered on the frontend of the site or created in admin.
The site has 3 store views (GBP, EUR and USD) and it happens on accounts created on all store views.
The migrated accounts from 1.9 aren't affected.
The grid at the bottom of the page never renders either. The spinner just spins.

Any ideas what might be causing this?


texts: Magento Change Product View Url Multiple Website Wise

texts:
I have created multiple websites in Magento,
and my website's homepages are working fine but When i am trying to view the product from the second website than product redirect to the first website(default).
does anyone know how to solve this issue?


texts: Magento2 Unable to serialize value string is corrupted while upgrading magneto version 2.1.8 to 2.3.2

texts:
While upgrading Magento version from 2.1.8 to 2.2.3 I have an issue.

The issue arises when I run command setup:upgrade. It will complete half of way Module 'Magento_Quote':

  Error converting field value in table quote_item_option where option_id=56822 using Magento\Framework\DB\DataConverter\SerializedToJson.
  Fix data or replace with a valid value.
  Failure reason: 'Unable to unserialize value, string is corrupted.'


texts: how to remove shipping cost from magento2 checkout summery

texts:
I am a beginner to Magento 2 and based on my some research I see that this whole block of cart subtotal is coming from

  /vendor/magento/module-checkout/view/frontend/web/template/summary/totals.html

Here some Knockout JS code is mentioned to getTemplate() JS function, which I don't know how to debug and reach to the HTML file from the data is coming

though the file

  /vendor/magento/module-checkout/view/frontend/web/template/summary/shupping.html

Looks like containing the data that I want to modify but when I make any changes in it and even flush the cache, and flush the static files. But none of the changes are appearing there.

Can anyone help me on this please? Do I have to run static content deploy to show the changes?


texts: How to avoid issue "Unable to find a physical ancestor for a theme"

texts:
I have already checked this topic and this one

But both them not actually solve 100% my real problem. My theme is installed via composer and it will placed in vendor folder. It's not have any parent for inheritance.
Sometimes magento recognize my theme but other try it'doesn't find it

My registration.php for theme

\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::THEME,
'vendors/VendorName/theme-name',
__DIR__
);

As you can see theme define above not like any other theme of magento will start with frontend folder

Is this is cause of my problem ? Can anyone in core magento team help me solve this issue! This problem maybe not bug of magento iam not sure
Expect results: I want 100% work theme when i run setup:upgrade . Not ramdomly fail


texts: Magento2 - Copy quote fields to order fields

texts:
In Magento2, i want to copy the quote custo  fields into order custom fields, i.e.

say, i have created a manufacturer column in quote_item which needs to be copied into sales_order_item table, manufacturer column, during order placed.

In Magento1, it was possible through


texts: Magento 2: Invalid credentials for ... aborting

texts:
I was trying to use composer install with my project, and this message show up, please help. Thanks :)
Or please tell me how to ignore a package in composer install, i've try composer remove magento/module-worldpay --update-with-dependencies but doesn't work, it said that package doesn't exists in composer.json

  composer.json

{
    "name": "magento/project-enterprise-edition",
    "description": "eCommerce Platform for Growth (Enterprise Edition)",
    "type": "project",
    "version": "2.2.4",
    "license": [
        "proprietary"
    ],
    "require": {
        "magento/product-enterprise-edition": "2.2.4",
        "composer/composer": "@alpha"
    },
    "require-dev": {
        "phpunit/phpunit": "~6.2.0",
        "squizlabs/php_codesniffer": "3.2.2",
        "phpmd/phpmd": "@stable",
        "pdepend/pdepend": "2.5.2",
        "sjparkinson/static-review": "~4.1",
        "friendsofphp/php-cs-fixer": "~2.2.1",
        "lusitanian/oauth": "~0.8.10",
        "sebastian/phpcpd": "2.0.4"
    },
    "autoload": {
        "psr-4": {
            "Magento\\Framework\\": "lib/internal/Magento/Framework/",
            "Magento\\Setup\\": "setup/src/Magento/Setup/",
            "Magento\\": "app/code/Magento/"
        },
        "psr-0": {
            "": [
                "app/code/"
            ]
        },
        "files": [
            "app/etc/NonComposerComponentRegistration.php"
        ],
        "exclude-from-classmap": [
            "**/dev/**",
            "**/update/**",
            "**/Test/**"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Magento\\Sniffs\\": "dev/tests/static/framework/Magento/Sniffs/",
            "Magento\\Tools\\": "dev/tools/Magento/Tools/",
            "Magento\\Tools\\Sanity\\": "dev/build/publication/sanity/Magento/Tools/Sanity/",
            "Magento\\TestFramework\\Inspection\\": "dev/tests/static/framework/Magento/TestFramework/Inspection/",
            "Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/",
            "Magento\\ToolkitFramework\\": "dev/tools/performance-toolkit/framework/Magento/ToolkitFramework/"
        }
    },
    "minimum-stability": "stable",
    "repositories": [
        {
            "type": "composer",
            "url": "https://repo.magento.com/"
        }
    ],
    "extra": {
        "magento-force": "override"
    }
}

  auth.json

{
   "http-basic": {
        "repo.magento.com": {
            "username": "[this is my public key on magento.marketplace.com]",
            "password": "[this is my private key on magento.marketplace.com]"
        }
    }
}