texts: registration.php and enable custom module

texts:
I am new to Magento and PHP, and I am using Magento 2.1.2. I tried to create a new module as explained in http://magentoexplorer.com/how-to-build-hello-world-magento-2-module-from-scratch. After creating the folders and files under app/code, and running php magento setup:upgrade, the first thing that is prompted, before the list of modules, is the code of my registration.php file. I don't know why this is happening; this is the first step before being able to see my module enabled.
I have Magento 2.1.2 installed over WAMP server, with sample data. Sample and admin page are working fine.


texts: how to get customer attributes in magento2?

texts:
I'm displaying customer attributes on Multiselect Textbox in General Tab.

In Magento 1.0 simply getting Customer Attributes by using below code

public function toOptionArray()
    {
        $attributes = Mage::getModel('customer/entity_attribute_collection')
            // remove filter to allow default address ID, etc.
            ->addVisibleFilter();
        $result = array();
        foreach ($attributes as $attribute) {
            if (($label = $attribute->getFrontendLabel()))
                $result[$attribute->getId()] = $label;
        }
        return $result;
    }

And add the attributes to system.xml file

<fieldname translate="label">
    Customer Attributes
    <frontend_type>checkboxes</frontend_type>
    <source_model>Test/source_customer_attribute</source_model>
    <show_in_default>1</show_in_default>
</fieldname>

From Magento 2.0 i don't know how to get Customer Attributes? Can you please Suggest me how to get customer attributes.

I have created system.xml file and it's related resource file.

system.xml

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/system_file.xsd">
    <system>
        <tab id="general" translate="label" sortOrder="100">
             General
        </tab>

            General
            <tab>general</tab>
            <group id="customersdata" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
                Customer Attributes
                <field id="allow" translate="label" type="multiselect" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1">
                    Customer Attributes
                    <source_model>Training\Test\Model\Config\Source\Customers</source_model>
                    <can_be_empty>1</can_be_empty>
                </field>
            </group>

    </system>
</config>

Training\Test\Model\Config\Source\Customers

<?php

namespace Training\Test\Model\Config\Source;

use Monolog\Handler\FirePHPHandler;

class Customers implements \Magento\Framework\Option\ArrayInterface
{

    protected $_options;

    protected $_customerCollections;

    public function __construct(\Magento\Customer\Model\Resource\Customer\Collection  $customerCollection)
    {
        //$this->_customerCollections = $customerCollection;
    }

    public function toOptionArray($isMultiselect = false)
    {

        //$attributes = \Magento\Customer\

       /* if (!$this->_options) {
            $this->_options = $this->$_customerCollections->loadData()->toOptionArray(false);
        }*/

        $options = $this->_options;
        if (!$isMultiselect) {
            array_unshift($options, ['value' => '', 'label' => __('--Please Select--')]);
        }

        return $options;
    }

}


texts: Object DOMDocument should be created on admin side

texts:
I have looked a lot but can't find the solution to this issue on my admin side

when I run php bin/magento setup:di:compile i get errors from 3rd party modules even these modules are off from config.php and also tried permission to genereted and var/di      .........thanks in advance

EDIT
I am using docker


texts: How to have multiple discount amount in single coupon code in Magento2

texts: Single coupon code but multiple discount amount depending on the country provided for shipping. i.e I need multiple discount amount with multiple country. Like i need discount amount $5 for Australia and $10 for Canada. How can this be implemented? Any help


texts:
we are using magento 1.9.0 version.

we  are trying to delete cache fodler, but it's not working.....

we tried in both ssh and in manual way. but still cache folder is not deleting.

if it delete also, within a minute cache folder will recreate with all following folders.

"mage-0, mage-1, mage-2............ mage-9 , mage-a, mage-b, mage-c....etc

please help me to find solution


texts: i see some products in "category products" but in "manage products" page i don`t found that products?

texts:
When i want to add new category i see some products in "category products" .

but in "manage products" page as you see i don`t found that products ??


texts: Stop generating URLs for German, Russia and French after reindexing catalog_url rewrites

texts: Can anyone please let me know how to stop generating urls for German, Russian and French stores after reindexing catalog_url. I tried disabliing stores in the system --> admin --> Manage Stores but still urls are generating for those stores. please help me in this. Thanks in Advance


texts:
My  default_header_block.xml path is

  app/design/frontend/custom-theme/my-first-theme/Magento_Theme/layout/default_head_blocks.xml

my css file

  app/design/frontend/custom-theme/my-first-theme/web/css/abc.css

But my abc.css file loaded inside following structure

  pub/static/frontend/custom-theme/my-first-theme/en_US/css/abc.css

it will not display source path..

I followed the below steps to clear cache:

remove files inside 'var' folder and inside pub/static/frontend

How can I display my Custom css source link in website?


texts:
I have implemented cart rules that gives discount when the user buys more than 20 items of a product.

The discount is shown in the cart, but not in the mini cart, which is very confusing for my customers.

How can I make the mini cart apply cart rules?


texts: paypointgateway module stuck on redirect page

texts:
I have the new paypoint module installed and it appears to be working, it can be configured and chosen as a payment option using the hosted method.

However, once the "place order" button is pressed and one would expect it to redirect to paypoint for payment, it just goes to a blank page with url/paypointgateway/hosted/redirect/ and sits there.

There is nothing in the paypoint log, the magento log or the apache log.

UPDATE:

In answer to the comment, the redirctAction is:

public function redirectAction() {
  return parent::_redirect_action(__METHOD__);
}

And the parent is:

protected function _redirect_action($child_method) {
     $html =
        $this
            ->getLayout()
            ->createBlock(
                $this->_redirectBlock,
                null,
                array('paymentMethodInstance' => $this->_getPaymentMethodInstance())
            )
            ->toHtml();
     $this->getResponse()->setBody($html);
}

So I'll look into the layout file.

UPDATE 2:

Ok, have narrowed it down to this part returning nothing, well, a zero length string.:

$html =
        $this
            ->getLayout()
            ->createBlock(
                $this->_redirectBlock,
                null,
                array('paymentMethodInstance' => $this->_getPaymentMethodInstance())
            )
            ->toHtml();

Note also that $this->_redirectBlock (a string) and $this->_getPaymentMethodInstance() (an object) are non-empty.


texts: Extension not being installed through magento connect in linux

texts:
Iam trying to install Magento Extension through magento connect I got the extension key and pasted it in the provided field and started installing but unizipping is done but  cannot get my extension moreover getting Error 503 please help me solve this.
here is my screenshot iam strucked here since half an hour.

and also getting error 503


texts: No Product Attributes in Catalog Price Rule Options

texts:
I'm trying to set up a catalog price rule based on size, but the only options listed for Conditions are Attribute Set and Category.

Is there something I'm missing here, or something I have yet to configure? I know I've been able to do this with other M2 stores. Any help would be greatly appreciated!


texts:
I have upgraded my store from Magento 2.2.7 to Magento 2.4.2 version and facing below error.
Warning: Class 'Zend\Mvc\Controller\PluginManagerSM2' not found in /var/www/html/vendor/zendframework/zend-mvc/src/autoload.php on line 15

Warning: Class 'Zend\Form\FormElementManager\FormElementManagerV2Polyfill' not found in /var/www/html/vendor/zendframework/zend-form/autoload/formElementManagerPolyfill.php on line 16

Fatal error: Class 'Zend\Stdlib\Glob' not found in /var/www/html/vendor/magento/framework/Filesystem/Glob.php on line 14

Any help would be greatful.


texts:
I have problem with the subtotal from the image below:

I have 28.45 , which is calculated in this function from : Mage_Adminhtml_Block_Sales_Order_Create_Items_Grid

    public function getSubtotalWithDiscount()
    {
        $address = $this->getQuoteAddress();
        if ($this->displayTotalsIncludeTax()) {
            $subtotalInclTax = $address->getSubtotal() + $address->getTaxAmount()
                    + $address->getHiddenTaxAmount() + $this->getDiscountAmount();
            return $subtotalInclTax;
        } else {
            return $address->getSubtotal() + $this->getDiscountAmount();
        }
    }

and 28.56 , which is calculated in the same class , in this function:

public function getSubtotal()
{
    $address = $this->getQuoteAddress();
    if ($this->displayTotalsIncludeTax()) {
        if ($address->getSubtotalInclTax()) {
            return $address->getSubtotalInclTax();
        }
        return $address->getSubtotal()+$address->getTaxAmount();
    } else {
        return $address->getSubtotal();
    }
    return false;
}

Normally I should have the same values. In my case the $address->getHiddenTaxAmount() and $this->getDiscountAmount() are 0 . So i only have $subtotalInclTax = $address->getSubtotal() + $address->getTaxAmount() for my first total (28.45) and in the second function I have this IF condition:

 if ($address->getSubtotalInclTax()) {
     return $address->getSubtotalInclTax();
 }

My question is why I'm getting the return value from that IF condition ? If it doesn't go inside it , it would return return $address->getSubtotal()+$address->getTaxAmount(); and everything would be perfect :)

Thank you!


texts: Add a product to a specific Store Group?

texts: I am trying to save a product programatically. How can i save that product to a particular store group alone. I read in the magento intro, that a storegroup is a collection of products, But i couldn't find any parameter in product model, which restricts a product to a store group.


texts: Move all native magento reviews from my default store 0 to my new store

texts:
My script currently works for all stores except the store it's pulling from. I want to pull all reviews from my default store / main store and only push the reviews to my new store with a websiteId = 13 and storeId = 13

Here's my code below:

<?php
require_once 'abstract.php';
class Mage_Shell_Review extends Mage_Shell_Abstract
{

    public function run()
    {
        $ids    = Mage::getModel('review/review')->getCollection()->getAllIds();
        $stores = Mage::getModel('core/store')
            ->getCollection()
            ->getAllIds();

        $adapter = Mage::getSingleton('core/resource')->getConnection('core_write');

        $table = 'review_store';
        try {
            $adapter->beginTransaction();
            $adapter->truncateTable($table);
            $values=array();
            foreach ($ids as $id) {
                foreach ($stores as $storeId) {
                    $values[]="($id,$storeId)";
                }
            }
            $values=implode(",\n",$values);
            $query="INSERT INTO $table (`review_id`,`store_id`) VALUES $values;";
            $adapter->query($query);
            $adapter->commit();
            Mage::app()->getCacheInstance()->flush();
            Mage::app()->cleanCache();
            echo "OK\n";
        } catch (Exception $e) {
            $adapter->rollBack();
            print_r($e->getTrace());
        }
    }
}

$shell = new Mage_Shell_Review();
$shell->run();

I haven't tested it yet because i don't want to effect all stores... i only need the reviews from default to populate the new store with the id of 13.


texts: How to get Quantity selected by customer on Product Page. Magento 2

texts:
I want to get the Quantity of the product selected by Customer on the Product page

And also wan to get Qty and the product price on the Grouped Product explained in the image


texts: Just wondering if there's a way for me to move the price between the image and the product title in upsell block?


texts: Magento 1.9 : How to redirect custom page after registration and then home page

texts:
How to redirect custom page after registration in Magento 1.9.2.4. In my custom page having the form if I submit that form ,then it will go to home page

I have verify.phtml

             <?php

               $isuserVerified = Mage::helper('test/Data')->isUserVerified(Mage::getSingleton('customer/session')->getId());
              if($isuserVerified == 'false'): ?>

            <?php /*?>

       <?php echo $this->__('*Please verify your mobile with OTP code.'); ?>

    <?php echo $this->__("Please Enter verification codes"); ?>

<input type="text" id="code" name="code" placeholder="Enter verification code" class="verify" />
<input type="button"  id="verify_mobile" value="Verify Mobile" class="button verify" />
<?php if(Mage::helper('test/Data')->canResendOTP())
    { ?>
Resend Code
<?php } ?>


texts: 502 error totals-information logged in customers after shipment selection

texts:
When some customers are logged in, the checkout is frozen after make a shipment selection, when i check the console this error is popup after several seconds:
Failed to load resource: the server responded with a status of 502 () rest/dutch/V1/carts/mine/totals-information when i googled it this error looks the same but when i checked the patch files it's already fix by Magento: https://github.com/magento/magento2/issues/14541
fix: https://github.com/ekuusela/magento2/commit/aa535ea5d4bf78915bddd4387a9d3c4b39943eea
I'm using M2.3.2, also tried to disable third party modules but no results..
It only happend with logged in customers, and not all customers.
Does anyone has seen this before?


texts: Magento 2: Issues with mobile navigation when moving navigation.sections with layout xml

texts:
I'm attempting to move navigation.sections into sidebar.main on a three column Magento 2 layout.

I have a custom theme inheriting Magento/blank. I have moved the navigation using:

MyVendor/mytheme/Magento_Theme/layout/default.xml

<?xml version="1.0"?>
<page layout="3columns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <move element="navigation.sections" destination="sidebar.main" />
    </body>
</page>

This renders as expected on desktop, and also on mobile.

However, when activating the menu on any category page, the grey overlay .nav-open .nav-toggle:after sits above the navigation. CSS z-index for the navigation/overlay seems to go out of the window.

This only occurs on category pages. On CMS and product pages the menu works as expected.

How would I go about diagnosing this further from here?


texts: Create attribute programmatically in magento2.3

texts:
I need to create brand attribute in fabric attribute set.

<?php

namespace XXX\YYY\Setup\Patch\Data;

use Magento\Framework\Setup\Patch\DataPatchInterface;
use Magento\Framework\Setup\Patch\SchemaPatchInterface;
use Magento\Framework\Setup\Patch\PatchRevertableInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Eav\Setup\EavSetupFactory;
use XXX\YYY\Model\Config\Source\Options;

class AddCustomManufacturerAttribute implements DataPatchInterface
{
    const ATTRIBUTE_NAME = 'brand';

    protected $eavSetupFactory;
    private $moduleDataSetup;

    public function __construct(ModuleDataSetupInterface $moduleDataSetup, EavSetupFactory $eavSetupFactory)
    {
        $this->moduleDataSetup = $moduleDataSetup;
        $this->eavSetupFactory = $eavSetupFactory;
    }

    public static function getDependencies()
    {
        return [

        ];
    }

    public function apply()
    {
        $eavSetup = $this->eavSetupFactory->create(['setup' => $this->moduleDataSetup]);
        $eavSetup->addAttribute(
            \Magento\Catalog\Model\Product::ENTITY, self::ATTRIBUTE_NAME, [
                'type' => 'int',
                'backend' => '',
                'attribute' => '',
                'frontend' => '',
                'label' => 'Brand',
                'input' => 'select',
                'class' => '',
                'source' => Options::class,
                'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
                'visible' => true,
                'required' => true,
                'user_defined' => true,
                'default' => NULL,
                'searchable' => false,
                'filterable' => false,
                'comparable' => false,
                'visible_on_front' => false,
                'used_in_product_listing' => false,
                'used_for_sort_by' => false,
                'unique' => false,
                'apply_to' => 'simple,virtual,downloadable,bundle,configurable',
                'group' => 'Fabric Attributes',
                'is_used_in_grid' => true,
                'is_visible_in_grid' => false,
                'is_filterable_in_grid' => true,
            ]
        );
        $eavSetup->addAttributeToGroup(
            \Magento\Catalog\Model\Product::ENTITY, 'Fabric', 'Fabric Attributes', self::ATTRIBUTE_NAME, 1
        );
    }

    public function getAliases()
    {
        return [];
    }
}

But the brand created in fabric attribute set and also default attribute set.

But,I need to create brand attribute only in fabric attribute set  .

If anything i want to change it.

Thanks.


texts: Pass parameter to controller from template Magento 2

texts:
I am creating product programmatically on controller action. I want to send price value from template file. This is my controller:

public function execute()
{
    if (!$this->session->isLoggedIn())
    {
        $resultRedirect = $this->resultRedirectFactory->create();
        $resultRedirect->setPath('customer/account/login');
        return $resultRedirect;
    }
    else
    {
        $resultPage = $this->resultPageFactory->create();
        $resultPage->getConfig()->getTitle()->set(__('My Wallet'));
        return $resultPage;

        $vat_exempt_name = $this->getRequest()->getPost('vat_exempt_name');

    //.............To Create Product...........//

    $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); // instance of object manager
        $product = $objectManager->create('\Magento\Catalog\Model\Product');
        $product->setSku('my-sku28'); // Set your sku here
        $product->setName('Sample Simple Product28'); // Name of Product
        $product->setAttributeSetId(4); // Attribute set id
        $product->setStatus(1); // Status on product enabled/ disabled 1/0
        $product->setWebsiteIds(array(1));
        $product->setWeight(10); // weight of product
        $product->setVisibility(4); // visibilty of product (catalog / search / catalog, search / Not visible individually)
        $product->setTaxClassId(0); // Tax class id
        $product->setTypeId('simple'); // type of product (simple/virtual/downloadable/configurable)
        $product->setPrice($vat_exempt_name); // price of product
        $product->setStockData(
                 array(
                      'use_config_manage_stock' => 0,
                      'manage_stock' => 1,
                      'is_in_stock' => 1,
                      'qty' => 99999
                      )
                     );
        $product = $product->save();
    }
}

This is my template file:

Enter Amount to be Added in wallet (USD)

 <input type="text" class="input-text watch-keyup" id="vat_exempt_name" name="vat_exempt_name" value="200">

 <button type="button">Add Money to Wallet</button>

How can I achieve it, Thanks.


texts: magento 2.1: Is it possible to make the admin page url work from two seperate URLs?

texts:
I'll explain our situation first for context: We are a canadian based company, so our Geo-IP location is Canada.

When we first setup our website, we had it setup as www.website.COM , however recently we acquired and installed a Geo-IP extension that allowed us to use our www.website.CA domain for our Canadian customers. This causes us one problem, we keep needing to log into our admin page using .com, however once in awhile we need to login remotely (from a cell phone for example), and when we do we get forwarded to .ca and then the admin page doesn't load.

Is there a way to make our admin page work from BOTH .ca and .com domains?
(both are on the same installation/server/etc).


texts: untag a product / remove a product-tag relationship

texts:
How to remove a tag/product relationship programmatically?

I've tried:

$tag_obj    = $tagModel->loadByName($tag);
$tagId      = $tag_obj->getTagId();
$customerId = $tag_obj->getCustomerId();

$relationModel = Mage::getModel('tag/tag_relation');

$relationModel->loadByTagCustomer($productId, $tagId, $customerId, $store['id'])->deactivate();

But it doesn't seem to do much, much less untag anything.


texts: How to remove the domain from the start of category in navigation menu

texts:
I have found that the navigation is giving us too many internal links which is not good for seo. To stop this i want the navigation menu to exclude the domain at the beginning of the url eg from: http://example.com/category/subcategory.html to /category/subcategory.html.

I have found this line:
        $html[] = 'getCategoryUrl($category).'">';
which i have found to change the urls. I want to make it not show the url at the beginning of the link. What do i need to change to do this, i cannot see what I need to remove or change.


texts:
I'm trying to import customers to a Magento 2 website. Data validation is OK (File is valid! To start import process press "Import" button), but when I click on import button, page gets stuck on please wait loader and I get error :

  POST
  https://www.my-domain.com/administration/admin/import/start/key/8adc97…ad82c7953b3d1041f73b2365f835465e6552bba89c2b456/&form_key=5VWWozeXbFPTNSAr
  500 (Internal Server Error) validation.min.js:6

I also tried to export / import existing customers (3) to be sure I did not have wrong data in my csv or too many customers.

Folders have the right permissions.

I'm using Magento 2.1.7 on a dedicated Linux server.

I can't find what could be wrong here, any idea ?


texts:
There are many themes which offer Quick installation or 1 click installer which not only activates the theme but also installs the Sample data (same as shown on theme demo). My Question is how can we add that functionality in our theme?

Some themes offering this feature are this and this


texts: Redirect back to admin area after customer session has closed.

texts:
I have developed a custom module with the help from @Marius, that allows a customer support team member to select a customer from the customer list in the admin section and logs them in as the customer and then redirects to shop.

I now need to the opposite, from a custom page in the client side I need to:

Clear the customer session
Redirect back to the customer list in the admin section.

This is the code I have in a new controller:

 // get customer list in admin section URL
 $customerUrl = Mage::helper('adminhtml')->getUrl('adminhtml/customer/index');
 // Logout customer session
 Mage::getSingleton('customer/session')->logout()->renewSession();
 // Redirect to customers page in admin section
 Mage::app()->getFrontController()->getResponse()->setRedirect($customerUrl);

This code kind works but I get redirect to the admin dashboard.

Please can you point me in the direction

Many thanks

Si


texts:
I currently use the following code to check if the attribute got a specific value.

<?php if ($_product->getAttributeText('brand_name') == "Cisco"): ?>

But now I need to add another value that it needs to check.

Is this the correct way to check this?

 <?php if ($_product->getAttributeText('brand_name') == "Cisco" && $_product->getAttributeText('brand_name') == "Dell"): ?>


texts: Where is the original price set in sales order item table?

texts:
In quote_item table we don't have a column original_price. So when and how sales_order_item table get the original_price value.

Post order we are seeing original_price as 0 in admin sales order view page. Unable to locate where the original price is set as 0 in the sales_order_item table.

Anybody have idea about this?


texts: Error when trying to reindex Product Prices

texts:
Hi I am getting the following error when I try to reindex product prices.

Invalid backend model specified: catalog/product_attribute_backend_finishdate

I recently had to remove an extension the prevented this. Store view pricing. I removed store id from all price tables, but no this appears. How can I solve this?


texts: Magento 2.4 Class Magento\Framework\Search\Adapter\Mysql\Mapper does not exist

texts:
I just upgraded my Magento version to the latest Magento version 2.4.0. after a successful upgrade, while I am trying to set production mode I am getting error like
    Compilation was started.
Area configuration aggregation... 5/8 [=================>----------]  62% 34 secs 340.0 MiB
In ClassReader.php line 43:

  Class Magento\Framework\Search\Adapter\Mysql\Mapper does not exist

In ClassReader.php line 36:

  Class Magento\Framework\Search\Adapter\Mysql\Mapper does not exist

setup:di:compile

anyone have idea how to fix it.
Thanks


texts: Magento2: Fatal error: Uncaught Error: Call to a member function setProduct()

texts:
newbie here.

I got the following error after moving date and file options to a different container.

Error: "Fatal error: Uncaught Error: Call to a member function setProduct() on boolean in /html/vendor/magento/module-catalog/Block/Product/View/Options.php:250"

<move element="product.info.options.date" destination="custom.date" before="-"/>
<move element="product.info.options.file" destination="custom.logo" before="-"/>

any ideas?


texts:
Magento 2 provides some serializers

 Magento\Framework\Serialize\Serializer\Json
 Magento\Framework\Serialize\Serializer\Serialize

Now they say this

    For security reasons, SerializerInterface implementations, such as the
Json and Serialize classes, should not serialize and unserialize objects.

What are those security reasons? Is this a fancy way of saying "We did not manage to implement this" I know there is a Serializer in Symfony that can do objects as well and no "security issues" raised there.

Thanks.


texts: Adding a CSS sheet to my CMS page Magento2

texts: I am creating a CMS page, what is the proper way to add a style sheet for this page, through the Layout Update XML field like this <head><css src="Magento_Contact::css/styles.css"/></head>, or do i put the css in the modules css/source/_module.less sheet (this seems to apply the css for this page on all pages across the site which is unnecessary and unwanted)?


texts: getting the total number of categories in store

texts:
what is the best way to get the total number of categories? I'd like to iterate over the total number.

thanks.


texts: Magento duplicate meta tags in google webmaster

texts:
I have magento 1.7.
For seo reasons I am getting Duplicate meta descriptions Tags problem from google.

For example

/paralympics-paralympische-spelen/
/paralympics-paralympische-spelen

(with and without the slash)

AND

/blog/
/blog/?p=2
/blog/?p=3
/blog/index/list/tag/oranje/

AND

/troonswisseling
/troonswisseling?dir=asc&limit=48&order=position

How can we make only 1 page exist (instead of all these combinations)

Thanks


texts:
How can I programmatically get the Category "Display Mode" if it have a "Products only", "Static block only" or "Static block and products" ?

Thanks for help.


texts:
hi all I am new to magento, I have a custom module here I save my form details but it's return an error

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

my code is:

public function postAction()
    {

        $session            = Mage::getSingleton('core/session');
        $data               = Mage::app()->getRequest()->getPost();
        $this->_data        = $data;

        $validate = $this->validate();

        if($validate === true){

                try {

                    $first_name = $this->getRequest()->getPost('full-name');
                    $email = $this->getRequest()->getPost('email');
                    $telephone = $this->getRequest()->getPost('telephone');
                    $comment = $this->getRequest()->getPost('comment');

                    Mage::log($first_name);

                    $contact = Mage::getModel('contactpro/contactpro');
                    $contact->setData('name', $first_name);
                    $contact->setData('email', $email);
                    $contact->setData('telephone', $telephone);
                    $contact->setData('comment', $comment);
                    $contact->save();

                    //$this->sendEmail();

                    $session->addSuccess($this->__('Contact has been accepted for moderation.'));

                    $pageThanks = Mage::getStoreConfig('contactpro/settings/page_thanks',$this->_getStore());
                    $this->_redirect($pageThanks);

                } catch (Exception $e){
                    Mage::getSingleton('customer/session')->addError($e->getMessage());
                    Mage::getSingleton('customer/session')->settestData($this->getRequest()->getPost());
                }

        }else{
            if (is_array($validate)) {
                foreach ($validate as $errorMessage) {
                    $session->addError($errorMessage);
                }
            } else {
                $session->addError($this->__('Unable to post the contact.'));
            }
            $this->_redirect('contactpro');
        }
    }

Can any one tell me where I went wrong? or suggest me.

thanks.


texts: getAllowWriteReviewFlag() Returns False so Can't write reviews

texts:
OK so we're in magento 1.8.1.0 and for some reason the following logic returns false all the time

<?php if ($this->getAllowWriteReviewFlag()): ?>

Even if I log in, I have the option "System > Configuration > Catalog > Reviews > Allow guests to write reviews" set to true, so technially that function should return true. If I log in, I get the same thing.

Also, I have checked that Mage_Reviews is enabled in System > Config > Developer > advanced

Any ideas?


texts: Am I hurting performance or using bad practice by including css within my static block?

texts: When I create a new section for my home page or a block for a category header is it bad practice to include  css within that block? My thought process is that when I want to remove or change that section I can go to one spot to control or disable everything.


texts: Allow multiple countries for billing but restrict for shipping

texts:
I have a site and I would like to allow people from three different countries to be able to shop, but want to (for now) restrict shipping to just one country (so someone in a foreign country can buy from the store and have it sent to a friend or family member in the local country). I read here about changing the specific countries in the shipping method. I tried it, but I'm still getting all three allowed countries in both the billing and shipping address.

I'm not sure whether the "ship to same address" checkbox has something to do with it, since it's checked by default. Say my allowed countries are Spain, USA and Guatemala, but I want to have shipping available only in Guatemala. If I select USA for my billing address the checkbox should uncheck itself because I can't use the same address for shipping. Also, perhaps it has something to do with the fact that to this point I haven't selected a shipping method yet, so the shipping address country dropdown displays all three countries.

What am I doing wrong? Is what I'm trying to do possible from the admin?

Note: I'm using the OnePageCheckout extension provided by Apptha. Also, I'm new to this forum.


texts: Search not working in special characters in magento 2

texts:
search not working Product names with special characters like semiautomático in magento 2

or any way to Ignoring special characters during catalog search?

how to solved this?

Thanks


texts: Image base name file or image in cache? what is the best method of use images for SEO purpose and copyright (with watermark) protection?

texts:
In these months I'm working on a Magento CMS for the first time (version 1.9.2.1). I came across a problem due to image bulk rename. The thing that was asked to me is to optimize image file for a good SEO.

I see that images are stored in 3 ways:

in DB
in /media/catalog/product folder
in /media/catalog/product/cache folder

I've found a great extension for work with the cached images (https://github.com/Vinai/nicer-image-names). I've integrated it making a little mod for work with all labels (instead to work only if labels are empties). and it works as expects.

But the problem remains, the owner of the site asked me if is possible to rename the base filename instead of the cached images, and... well.. seems various people have this idea but no one try to work on this way (at least sharing that for free). Furthermore, the site uses a watermark added by Magento for the images which are produced by ourselves.

After all these premises my questions are:

What is the best usage solution for Magento images?
Is it better use the /media/catalog/product folder or the cached images in /media/catalog/product/cache/ ? (nearly sure is better to use cache and hide /media/catalog/product from robots.txt due to watermark, but is better to ask...)
What is the purpose of having them also in the DB?
What is the purpose of having them sorted by first char / second char in /media/catalog/product/first-char/second-char ?


texts:
how to fix this issue?
I also try to change web/secure/base_url

http://i.stac

k.imgur.com/QytN5.png


texts: checkout success page - Can't get order id & customer id

texts:
I want to get customer id & order id at order success page.

Already tried this : Success page get customer name and order id ..But not working

In index controller

public function successAction()
    {
        $this->_getState()->setCompleteStep(
                Xx_Multistepcheckout_Model_Type_State::STEP_OVERVIEW
            );
        $this->_getState()->setActiveStep(
            Xx_Multistepcheckout_Model_Type_State::STEP_SUCCESS
            );

        $this->loadLayout();
        $this->_initLayoutMessages('checkout/session');
        $ids = $this->_getCheckout()->getOrderIds();
        Mage::dispatchEvent('checkout_multishipping_controller_success_action', array('order_ids' => $ids));
        $this->renderLayout();
    }

In order success page

$_orderIds = $this->getOrderIds();

But it's not giving any order Id's.

So to get order details I've tried following code in order success page.

$order = Mage::getModel('sales/order')->load(Mage::getSingleton('checkout/session')->getLastOrderId());
print_r($order->getData());

It's also giving me an empty array.

Can you please suggest me what should I can do to get order id and customer id in order success page.


texts: Disable payment section using plugin feature in Magento 2

texts: I'm doing some functionality in Magento 2 plugin feature. Here I took the shipping information before saving it and checked the delivery availability. Now I need to prevent the next step payment if the delivery is not available for any of the product.


texts:
There's a time issue I've noticed with saving new customers and the created_at attribute, where if you save the model twice, the time stored will be incorrect. To get around the issue you can call load() directly after the first save.

For example, you set the customer data, and then call save(). Created_at gets set with Mage_Eav_Model_Entity_Attribute_Backend_Time_Created::beforeSave() which uses Varien_Date::now(), which generates a date time stamp in UTC.

public function beforeSave($object)
{
    $attributeCode = $this->getAttribute()->getAttributeCode();
    $date = $object->getData($attributeCode);
    if (is_null($date)) {
        if ($object->isObjectNew()) {
            $object->setData($attributeCode, Varien_Date::now());
        }
    } else {
        // convert to UTC
        $zendDate = Mage::app()->getLocale()->utcDate(null, $date, true, $this->_getFormat($date));
        $object->setData($attributeCode, $zendDate->getIso());
    }

    return $this;
}

Customer_entity.created_at is mysql type timestamp, not datetime, so when this gets saved, it also stores the timezone. After the first save, the time in memory is in UTC, and the column is in UTC (+0000).

After the second save, beforeSave() gets called again. However, the object is not considered new anymore and it assumes the time in memory is stored in the store local time, as that's what afterLoad() does. The time gets incorrectly converted from store local time to UTC time before saving, when the time in memory is actually still in UTC, so the time stored has actually twice the intended offset.

So I'm curious, is this a Magento bug? Or is it considered standard practice that after the first time you save a model, that that is considered the end of life for that object? That would not make sense, because of course people may want to create after_save observers for that object and perform additional tasks with it. Would love to hear anyone's input.


texts: Event checkout_cart_add_product_complete - Get Quote Item (follow up question)

texts:
I'm observing the checkout_cart_add_product_complete event and need to get the added quote item.

There was a previous post on this issue with a suggestion to flag the new quote item in checkout_cart_product_add_after and then access it in checkout_cart_add_product_complete.

My question is on a basic level - how exactly do I implement this solution if I only get passed the product in checkout_cart_add_product_complete?

Link to previous post: Watching Add to Cart Event - quote item id is empty


texts: In stock, freshly uploaded product showing out of stock on frontend - Magento 2

texts:
I am using marketplace module but the products uploaded by vendors are showing 'Out of stock'. However, if I upload any product from backend it shows 'In stock'. I've tried this on all type of products i.e simple, virtual, bundle, configurable and downloadable products. If the product is uploaded from admin side it shows 'In Stock'. If the product is uploaded from vendor side it shows 'Out of Stock'.

I've checked the inventory to show out of stock, if and only if the QTY left is 0, but still facing the error. I've reindexed the data and flushed and cleared cache but still, nothing changed. I've also checked the product QTY and replace quantity by 100 (100 product in stock) but still, they are showing out of stock on the frontend.
Is there anyone who can help me figure out what the problem is?


texts: Can't show category products in home page

texts:
I'm trying to show products from a specific category in home page.

I have inserted content into CMS > Pages > HP as follow

A
{{block type="catalog/product_list" column_count="4" category_id="28" template="catalog/product/list.phtml"}}
B

Category 28 is anchor. Category 28 contains valid products. Cleared the cache many times.

When I reload the home page the result is:
AB


texts: I get redirected to https://www.hugedomains.com/domain_profile.cfm?d=magtest&e=com

texts: I just installed magento on my localhost but when I try to access it for the first time with localhost/magento/admin i get redirected to that page.


texts: Is it possible to have a customised Image URL Path?

texts:
We're in the middle of looking at the benefits of using Magento rather than Actinic/Sellerdeck, but one of the main problems we cannot find a way around so far is that we would need to keep our image paths as our images are referenced elsewhere, such as eBay. Under Sellerdeck all our image URLs are under one location, so for example the image "bob.jpg" will always be under "http://[site URL]/acatalog/bob.jpg".

It wouldn't be a problem for new images to have a different structure, but we need all our old products images to still be available under these URLs, there's just too many to change manually, does Magento have any support for this?


texts: Magento 2 - Wordpress Integration url issue

texts:
I am using a magento 2.1.8 site.
I have installed wordpress in a subdirectory of my root directory.
I have integrated the wordpress and magento site by using fishpig wordpress extension.
All other things are working fine. Now I got all my wordpress post in this url www.example.com/blog

The issue is I have assigned few categories to a post, For example,blog,category1,category2,category3 etc.

When I take the post in browser, it shows the url as www.example.com/blog/blog/posturl/.

I want the post url as www.example.com/blog/category2/posturl/.

How can I do it? When ?I tried the permalinks extension in wordpress,but still the issue  exist.


texts: How can I process Credit cards on my Magento store?

texts: My Magento store is PCI complaint. I don't like redirecting customers from my store to bank's website for entering credit/debit card details. Is there any way I can collect the card information on my store and then pass it onto banks' website so that customers just have to enter the 3D-secure PIN?


texts:
I have this code: http://pastebin.com/iFwyKM7G

Inside an event-observer class which executes after the customer registered. It creates an order automatically and it works for simple products.  However I cannot figure out for the life of me how to make it work with Bundled product!

How can I make this work with a bundled product? What extra things do i need to set? Since then i figured out that i need these options:

$products = array(
            '2' => array(
                'qty' => 1,
                'bundle_option' => array(
                    2 => 2,
                    1 => 1,
                ),
                'bundle_option_qty' => array(
                    2 => 1,
                    1 => 1,
                ),
            ),
        );

yet i dont know what function i need t ouse to add that options to my bundle product.


texts: Call to a member function dispatch() on null Magento\Framework\Model\AbstractModel.php on line 562

texts:
Why do i get this dispatch() on null error from my custom module

My error stack trace says:

Vendor\Module\Observer\SyncObserver->execute( ) ..\InvokerDefault.php:73

Vendor\Module\Model\Engine->productUpdate( )    ..\SyncObserver.php:35

Vendor\Module\Observer\SyncObserver.php

 <?php
namespace Vendor\Module\Observer;

use \Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;

class SyncObserver implements ObserverInterface
{
   protected $syncEngineFactory;

   protected $logger;

 function __construct
(
    \Vendor\Module\Model\Engine $syncEngineFactory
)
{
    $this->syncEngineFactory = $syncEngineFactory;
}

 public function execute(\Magento\Framework\Event\Observer $observer)
{
    $event = $observer->getEvent();
    $this->syncEngineFactory->saleOrderComplete($observer);
    $this->syncEngineFactory->productUpdate($observer);
    $this->syncEngineFactory->productDelete($observer);
}

etc/events.xml

  <event name="catalog_product_save_after">
    <observer name="catalog_product_save_after_handler" instance="Vendor\Module\Observer\SyncObserver"/>
</event>


texts: How to override UPS shipping Carrier in magento 2

texts:
I am trying to override UPS shipping Carrier. But it is not override.

etc/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
     <preference for="Magento\Ups\Model\Carrier" type="Sarvesh\Tiwari\Model\Carrier" />
</config>

Sarvesh/Tiwari/Model/Carrier

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

// @codingStandardsIgnoreFile

namespace Sarvesh\Tiwari\Model;

use Magento\Quote\Model\Quote\Address\RateResult\Error;
use Magento\Quote\Model\Quote\Address\RateRequest;
use Magento\Shipping\Model\Carrier\AbstractCarrierOnline;
use Magento\Shipping\Model\Carrier\CarrierInterface;
use Magento\Shipping\Model\Rate\Result;
use Magento\Shipping\Model\Simplexml\Element;
use Magento\Ups\Helper\Config;
use Magento\Framework\Xml\Security;

/**
 * UPS shipping implementation
 * @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
 * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
 */
class Carrier extends \Magento\Ups\Model\Carrier
{
    public function collectRates(RateRequest $request)
{
    $this->setRequest($request);
    if (!$this->canCollectRates()) {
        return $this->getErrorMessage();
    }

    $this->setRequest($request);
    $this->_result = $this->_getQuotes();
    $this->_updateFreeMethodQuote($request);
   return $this->getResult();
}
}

but its not working anyone can help


texts: How to include Toolbar in my custom module in magento2

texts:
I want to add toolbar in my custom collection which are comes from database , How to call toolbar in my custom Module any one have an idea in magento2.
I want to show toolbar as same like display in product list page.
I want this type of toolbar in my custom collection of module:


texts: What is the difference of addAttributeToFilter() Vs addFieldToFilter()?

texts:
I'm bit of confused what is the difference of addAttributeToFilter() and addFieldToFilter() functions. I checked the core files in magento. But I could not figured out a clear idea. Because for some of the collections in magento has used addAttributeToFilter() and some have used addFieldToFilter().
Please any clarification on this would be a great help.
Thanks in advance.


texts:
I'm using Magento 2.3.
How can I fix Admin>Sales>Orders?
The list is not showing.
I have orders but it's not showing.

Please help!!


texts: Category (product Listing) page css update with Magento 2 custom theme

texts: I am building a custom theme, Luma is the parent theme. I am trying to customize the product listing page (category page) like this . Can you please help me which less file that I need to update also how to add custom less file.


texts: How to add new custom field in checkout/shipping page and save it in db in Magento2.2.5?

texts:
I want to add new custom field in checkout/shipping and want to save them in the following tables in Magento 2.2.5:

sales_order
sales_order_address
sales_order_grid

I have referred this link https://codeblog.experius.nl/magento-2-add-extra-billing-or-shipping-field-to-the-checkout/

But it is showing the custom field in backend at customer section. But not able to see it in frontend

Any help would be appreciated.


texts: Category saveAttribute only saves on store scope

texts:
I'm making a setupscript in Magento 1.7 CE to move some category data from one attribute to another. The script is working, but somehow it only saves on store view scope (just store view id 1), although I explicitly tell it to save on admin scope.

My current code:

<?php

$installer = $this;

$installer->startSetup();

$categories = Mage::getResourceModel('catalog/category_collection')
    ->addAttributeToSelect('description')
    ->addAttributeToSelect('text_onder')
    ->addAttributeToFilter('description_position', 0)
    ->setStoreId(0)
    ->addFieldToFilter('entity_id', 93)
    ;

$resource = Mage::getModel('catalog/category')->getResource();

foreach ($categories as $category) {
    $object = new Varien_Object(array(
        'entity_id'     => $category->getId(),
        'description'   => '',
        'text_onder'    => $category->getDescription(),
        'store_id'      => 0
    ));

    $resource->saveAttribute($object, 'text_onder');
    $resource->saveAttribute($object, 'description');
}

$installer->endSetup();

The filter on entity id is just for testing of course.

The attribute text_onder was created like this:

$installer->addAttribute('catalog_category', "text_onder", array(
    'group'             => 'General Information',
    'type'              => 'text',
    'input'             => 'textarea',
    'label'             => 'Tekst onder',
    'visible'           => 1,
    'required'          => 0,
    'user_defined'      => 0,
    'searchable'        => 0,
    'filterable'        => 0,
    'comparable'        => 0,
    'visible_on_front'  => 1,
    'visible_in_advanced_search'    => 1,
    'is_html_allowed_on_front'      => 1,
    'is_configurable'   => 0,
    'global'            => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
    'wysiwyg_enabled'   => true,

));


texts: All other CMS pages redirecting to home page

texts: I am creating a marketplace using Magento 1.9 and I have discovered that all my CMS pages like "about us", "contact", "terms and conditions" etc are not opening but are automatically redirecting to the home page. Even when I click on preview from the admin backend side they still redirect to homepage.  However product, category pages, login page and checkout pages are working. What can I do to fix this?


texts: Widget Parameters - How can I show a second select options based on first select?

texts: I want to provide 2 select parameters on the widget but I want the options of the second to be based on the option selected on first.If I choose the shop, then I have to go to database to get the services of that shop. How can I get the value chosen on first select, then go to database and then present the services options?


texts:
I have verified that the cron script is running, but order confirmation emails are not being sent out. When I open cron.php I see nothing in there regarding emails. Do I need to add anything to the file to make it send the emails?

Thanks


texts: Magento 2 Enterpise site with large SKUs count

texts: I would like to check out an existing Magento 2 Enterpise site with 10s of thousands of SKUs.  Any suggestions?


texts: How to modify/preprocess data before displaying in admin grid in Magento 2

texts:
I'd like to make some modifications before displaying it in admin grid. For now all what I want to do is just simply replace 0 and 1 in a column with Yes/No. There are a two ways that come to my mind.

First way is to modify the data before passing them to grid. (How? By an interceptor? Maybe there is there a way to modify the model collection?)

Second way is to make an own ui component that will handle that job.

What's the right way to do it?


texts: How to remove ?___from_store=default from other store code url of my magento 2 website?

texts:
I have 2 stores on my Magento 2 website.
one for Srilanka & the other for Australia.
I am redirecting my customers based on customer's IPs to relevant sores.
Whenever I am redirecting the customer to an Australian store, I am getting the URL like below
https://staging.mywebsite.lk/aus/?___from_store=default

After going through the product page and category pages URL is appearing without /?___from_store=default
I tried 302 redirects using htaccess file like below.  But no luck.
Redirect 301 /aus/?___from_store=default https://staging.mywebsite.lk/aus/
This is happening only on the home page. How can I remove this from my url? please help to short this out.


texts: Add completely new currency to Magento 2

texts:
Official currency in Iran is Rial. But when people want to buy something they use toman which is 1/10th of rial. For example 1000 rials is 100 toman. That's why I need to add toman to list of currencies that magento has. Ib magento 1, by editing  lib/Zend/Locale/Data/en.xml  and lib/Zend/Locale/Data/fa.xml   , I could add the new currency to Magento, but in magento 2, even by editing those files, nothing happens.

How can I add this new currency to magento?


texts:
How to get product details in magento 2.
How to do something like below in Magento2 Mage::getModel('catalog/product')->getCollection()


texts: Magento 2: How to implement First Order Discount?

texts:
I am planning to give the discount to the customers for their first order purchase.

After shipment selection, I want to show the discount in the order summary(discount is only for the first order).

Is there any event observer available after shipment selection? which is the best way to achieve this (Programmatically or admin side promotion)?


texts: Multiple fields per row in Magento admin edit form

texts:
I have asked this on Stack Overflow but had no response at all. Hoping to gain some attention on here.

I know there are similar questions out there for this but none of them provide a working answer.

I am creating a form using $fieldset->addfield();. My code is the following:

$fieldset->addField('monday_open', 'select', array(
            'label'    => "Monday",
            'required' => false,
            'name'     => 'store_title',
            'values'   => array(
                '00' => '00',
                '01' => '01',
                '02' => '02',
                '03' => '03',
                '04' => '04',
                '05' => '05'
            ),
            'container_id' => 'some_row'
        ));
        $fieldset->addField('monday_close', 'select', array(
            'required' => false,
            'name'     => 'store_title',
            'values'   => array(
                '00' => '00',
                '01' => '01',
                '02' => '02',
                '03' => '03',
                '04' => '04',
                '05' => '05'
            ),
            'container_id' => 'some_row'
        ));

This, as you will know, prints 2 table columns per row, one label and one field. I am wanting multiple (3, 4, 5, etc) fields per row.

I am only new to Magento so it is very possible I am missing something.

Is there a way to customise the table that is used in these forms? I dont have a template linked in my layout xml. This file is as follows:

<layout version="0.1.0">
<stores_adminhtml_index_index>
    <reference name="content">
        <block type="stores/adminhtml_grid"  name="stores" />
    </reference>
</stores_adminhtml_index_index>

And here is the contents of Block/Adminhtml/Grid.php:

class Pivotal_Stores_Block_Adminhtml_Grid extends Mage_Adminhtml_Block_Widget_Grid_Container
{

    public function __construct() {
        $this->_controller = 'adminhtml_stores'; // Adminhtml/Stores
        $this->_blockGroup = 'stores';

        $this->getHeaderText = "Our Stores Management";

        $this->addButtonLabel = "Add a Store";
        parent::__construct();
    }
}

Really hoping there is a ~simple~ way to do this in php but, if not, can someone please let me know how I can create a custom layout/template for this?


texts: Magento 2 Export & Import CMS Blocks and CMS Pages

texts: How to Export and Import CMS Pages and Static blocks ?


texts:
I want to call logger by objectManager on Model
But I don't know how to call logger object.

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$logger = $objectManager->get('which object');


texts: Is it posibble to use two shipping method together in magento?

texts:
I have a scenario where a customer placed an order which have 5 items. Now i want to apply two shipping method such that first shipping method applies on two product and second shipping method applies on other three products.

My idea to do :
I have made an attribute in edit product section when we select it yes that product should use the first shipping method all other products should use the default shipping method even if the order is same.

Is it possible to do , and any one have any idea please share it.

Thanks,
Sarvagya


texts: creating new options for magento attributes

texts:
I'm having problems trying to create a new option "Manage Options" when creating an attribute, do not know how to save the data correctly in the database, I'm overwriting "Mage_Adminhtml_Block_Catalog_Product_Attribute_Edit_Tab_Options" with my module to create custom fields, I want he save these fields when I save the attribute.

My Module:

config.xml

<config>
        <blocks>
            <adminhtml>
                <rewrite>
                     <catalog_product_attribute_edit_tabs>Ceicom_Swatches_Block_Adminhtml_Tabs</catalog_product_attribute_edit_tabs>
                     <catalog_product_attribute_edit_tab_options>Ceicom_Swatches_Block_Adminhtml_Options</catalog_product_attribute_edit_tab_options>
                 </rewrite>
             </adminhtml>
        </blocks>
</config>

Ceicom/Swatches/Block/Adminhtml/Options.php

class Ceicom_Swatches_Block_Adminhtml_Options extends Mage_Adminhtml_Block_Catalog_Product_Attribute_Edit_Tab_Options
{
    public function __construct()
    {
        parent::__construct();
        $this->setTemplate('ceicom/attribute/options.phtml');
    }
}

in the phtml file I put in the custom fields

any idea how I can save the values of these fields in the bank correctly?


texts:
I added custom field to the category admin. Now I can get this in viewer.

<?php echo $_category->getInternalTitle() ?>

But how to change default category H1 title(name) to this "internal_title"?


texts: SSL Magento 1.9 but receiving Your web server is configured incorrectly

texts:
I successfully implemented SSL on our website and went the LetsEncrypt to get my CA. All is set properly and in working order except one weird issue I am encountering post enabling.

  Your web server is configured incorrectly. As a result, configuration files with sensitive information are accessible from the outside. Please contact your hosting provider.

I followed the instructions found via documents, articles, etc to enable SSL, set base URL and Secure URL to "https://", SSL_OFFLOADED and Use Web Url Rewrites to no. All was fine before I switched and I wasn't getting that error above. Now I am. Any ideas? My .htaccess appears to be proper and my permissions on the folders on my server are various 644, 755, etc.

How do I resolve this issue?

EDIT: I am running my site on Ubuntu 14.0.4. LetsEncrypt used for my SSL. Green lock appears for frontend and admin area with no issues. Urls all work but include index.php. I am trying to remove that index.php from the urls for friendlier ones.


texts: Unable to add to wishlist when visibility is set to "not visible individually"

texts:
We are unable to add products to the wishlist in 1.6.2.0 when visibility = "Not visible individually".
I have explored two options so far:
Enable Catalog visibility and remove category
The problem with this is we use the products' categories for many things, and having them without a category will cause other issues.
Enable Search visibility
The problem here is that we have some products where a search will return hundreds of results, and the grouped products will be lost in the jumble.
What other alternatives are there?  Ideally we want every enabled simple product to be available to add to a wishlist.


texts: Checkout billing address same as shipping address

texts: I have a question for when a client is logged in. If in checkout, I don't want my billing address to be the same as shipping, I have a select input to choose another one. But I want the design to be like the shipping one. To have some elements in a square and select the address you want. Do you know how I can do something like this? I tried inspect that select because firstly I wanted to take the option's value, but I don't have any values there. And the text from that option isn't complete so I can choose it. Thank you!


texts: Magento 2.7 and 2.1.1 - While changing the password form the my account page User group changed to default customer group

texts:
While changing the password from the my account page user group changed to default customer group.
For example :
1) I have created Customer group named "XXXX Group"
2) I have created a user with "XXXX Group" from admin panel.
3) When i change the password from the my account change password section, the current user group has been assigned to default User group.
Note:
I have checked both the versions 2.0.7 and 2.1.1, which facing the same issue.
kindly provide the solution

Expectation: When i change the password, user must be assigned to expected "XXXX Group"


texts: How to rewrite url between page and category?

texts:
I'm a magento beginner.
I have problem. please help me

My problem is I have create one category(about us) and one page(about us).
when i click in menu category(about us), it will show the page(about us).
I tried two more times. I spent the full day. help me.

Thanks in advance.


texts: Can't save customer in CE 1.9 without providing current admin password

texts:
It seems like since upgrading to CE 1.9.1.0 I'm not able to modify any customer information without proving my current administrator password.

Surely this should only be required when trying to change the customer password or something along those lines?

Is this how it should behave??

Edit - JS Error on page load:

The error reads as follows:

  Uncaught TypeError: $(...).on is not a function

  (anonymous function) @ (index):1189

Which refers to:

$$('#_accountnew_password,#account-send-pass').each(function(elem) {
    $(elem).on('change', function() {


texts:
I have to do some Backup and now magento 1.9 display this message in local server Not enough permissions to create backup.
What can i do ?


texts:
I've tried many regex, but I'm still not able to find the one for accepting these kind of phone numbers:

003466655544
 and
+34666555444
 and
(+34)666555444


texts:
Got the error below when I run the setup:di:compile command

  [Magento\Framework\Exception\LocalizedException]
  Source class "\Magento\Framework\EntityManager\OperationInterface" for
  "Magento\Framework\EntityManager\Operation\ExtensionInterface" genera
  tion does not exist.

How can I solve the issue?


texts: Magento 2 deployment from Dev to Staging using Git

texts:
I have a local Dev environment and installed Magento 2 using composer
I initialized the local /magneto2/ folder as a Git repo
I added this .gitignore file to the root of my /magneto2/
folder
I have a remote repo ready to use on Beanstalk

From the Beanstalk remote repo I want to deploy the code to the Staging server

What are the steps now to deploy all my files to the Staging server
(through the Beanstalk remote repo)?
How do I setup my Magento 2 site on the Staging server with correct database settings etc?


texts: Magento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?

texts:
I want to get all the location names from the Multi Source Inventory (MSI). How could I get a collection of all locations in my custom module?

Here I want to create a new multi-select product attribute name "place", which has the values of all source names as its attribute values.

i.e. if there are 3 sources "US, UK, IN" then attribute has the same values "US, UK, IN" in product form.

  How could I achieve this functionality? Do anyone have an idea about
  it?

I have attribute script as below:

$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

    $eavSetup->addAttribute(Product::ENTITY, 'place',
        [
            'group' => 'General',
            'sort_order' => 30,
            'type' => 'text',
            'backend' => '\Module\Name\Model\Backend\Place',
            'frontend' => '',
            'class' => '',
            'label' => 'Place',
            'input' => 'multiselect',
            'source' => '',
            'global' => ScopedAttributeInterface::SCOPE_GLOBAL,
            'visible' => true,
            'required' => true,
            'user_defined' => false,
            'default' => '',
            'searchable' => true,
            'filterable' => true,
            'comparable' => false,
            'visible_on_front' => true,
            'used_in_product_listing' => true,
            'unique' => false
        ]
    );

Thanks in advance.


texts:
I'm working on building a new Magento shop (this is my first with Magento).

I'm looking to replicate the look of an existing shop for my product pages, at least in terms of layout:

http://www.panamericantool.com/cobalt-drills/drill-stops.html

http://www.panamericantool.com/screw-driver-bits/paint-cutters.html

I've figured out that I need to use grouped products, with simple products to create the kind of thing I'm after.

In the examples above, each product has separate attributes, I assume these are done via different attribute sets in Magento.

However how do they go displaying those different table headings/values in the theme?

I know I can do ->getAttributeName() or ->getAttribute('attribute_code') in the grouped.phtml file, but this would result in a vast amount of if (->getAttributeName() != '')... and I'd need to change the template when adding more.

I'm sure there is a way of getting all attributes and looping over them, but then how would you differentiate between say the meta_description attribute (also returned by the $_product->getData() method) and an attribute I'd want listed in the table?

How could I achieve something akin to what they have?

I'm also concerned about performance the shop will have 5k products at launch, growing to perhaps 25k-30k as we add our remaining stock. Many of these will need different attributes, but I'm guessing I could share attributes between attribute sets without too many performance issues?

Update:

I've carried on playing around with this, I've found this to get all of a products attributes, however I still don't know of a simple way of showing on certain values on a grouped product table?

$attributes = Mage::getModel('catalog/product_attribute_api')->items($_product->getAttributeSetId());
foreach($attributes as $_attribute){
    print_r($_attribute);
}


texts: mini-cart not working on homepage but it's work on other pages

texts:
Homepage Vs other pages

My theme structure :

  I didn't use requirejs-config.js in my theme

Problems:

My minicart doesnt't show count item on home page. it show on all other pages.

Here's my minicart.phtml file

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

// @codingStandardsIgnoreFile

/** @var $block \Magento\Checkout\Block\Cart\Sidebar */
?>

    <a class="action showcart" href="<?= /* @escapeNotVerified */ $block->getShoppingCartUrl() ?>"
       data-bind="scope: 'minicart_content'">

<?//= /* @escapeNotVerified */ __('My Cart') ?>

    <?php if ($block->getIsNeedToDisplaySideBar()): ?>

            <?= $block->getChildHtml('minicart.addons') ?>

    <?php endif ?>

  I think this Javascript doesn't load in my homepage

it show these errors on console


texts: How to call cms block of block type into custom header

texts:
I've made code of most viewed products which I'm trying to call under custom header. This is what I've done so far.

Posted the block code under cms block by name 'most_viewed'.

{{block type="mostviewed/list" name="home.mostviewed.list" alias="product_homepage" template="catalog/product/mostviewed.phtml"}}

and then I've posted the below code under my custom header but it's showing block. Suggest me some good idea to do.

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('most_viewed')->toHtml(); ?>


texts: Steps to change from flat structure to EAV

texts:
We're having problems with indexing and I want to see if switching from the flat structure to EAV resolves it.

I can't find anything online that deals with switching like this (lots going from EAV to flat but nothing about the reverse process)

Is all I need to do make the changes in

  system > config > catalog> catalog > frontend

Anything else to consider? (I know about the performance downside)


texts:
I Just updated to magento 1.9 and I really love the responsive theme. The colors, the look, and everything about it.

I really would love to keep it but I am keep getting:

  Fatal error: Call to a member function getSortedChildren() on a
  non-object in
  /home/fileserver/public_html/app/design/frontend/rwd/default/template/catalog/layer/state.phtml
  on line 36

by were the side navigation, where all the sub categories are.

Coding is still new to me so any help would be really appreciated!

35: $_filters = $this->getActiveFilters();
36: $_renderers = $this->getParentBlock()->getChild('state_renderers')->getSortedChildren();


texts: Magento 2 Url Key of Configurable Simple Product are same

texts:
I had migrated my store to the latest version, now I am facing an issue:
Some Configurable Simple Product have same Url key,

Below are the Simple Products of a Configurable Product:

Is there any way to solve this?


texts: Magento 1.9.1 CE display items as sold, not out of stock on frontend

texts:
Magento Experts, we're an online pawn shop and currently don't stock retail inventory in volume.  What I mean by this is that we obtain items to be put out for sale either by purchasing the item or the single item becoming inventory due to a pawn loan forfeiture.

We would like to display an item that has been sold on cart pages as "SOLD", not "Out of Stock".  Is there a simple way of doing this?  Your help is greatly appreciated.


texts: Get all products instead of a specific category?

texts:
I use the following code to get products of specific category:

$products = Mage::getModel('catalog/category')->load($category_id)
 ->getProductCollection()
 ->addAttributeToSelect('*') // add all attributes - optional
 ->addAttributeToFilter('status', 1) // enabled
 ->addAttributeToFilter('visibility', 4) //visibility in catalog,search
 ->setOrder('price', 'ASC'); //sets the order by price

But how can I obtain all products instead?


texts: Magento How to custom "price" font size for product page only

texts: I'm trying to change font size and color for "Price" on product page only. When I change .price on style.css it would change price format on all pages which is not what I need. I need to change price format on product page only.


texts: Magento 2.3 : How to use Elastic search?

texts:
As we all know that since Magento 2.3 CE released It supports Elastic Search without using any 3rd party vendor.

How Can I configure it ?

Note : I don't want to use other vendors for now.


texts: How to override payment page place order button in Magento 2.2.x?

texts:
I need to disable 'Place Order' button on payment page based on logged customer group data. I see following in one of the payment method's template HTML file.

Any idea on which block or helper need to be overwritten to add custom code and call that method in the html file?
I overwrote cc_form.html file in custom module using requiresjs-config.js and it's working but need information on getting customer data into the template.

I would like to do this in custom module, don't want to update out of box code.

<button data-role="review-save"
    type="submit"
    data-bind="
    attr: {title: $t('Place Order')},
    enable: (getCode() == isChecked()),
    click: placeOrder,
    css: {disabled: !isPlaceOrderActionAllowed()}
    "
    class="action primary checkout"
    disabled>


texts: magento 2 how to get product id from admin

texts:
In my requirement, I need product id from the admin product edit page on how to achieve this in Magento 2.
 I have tried
$productId = $this->request->getParam('id');
but it is empty

  Model File:-

<?php

namespace Vendor\Module\Model\ResourceModel\Collection;

use \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection;

class Collection extends AbstractCollection
{
    /**
     * @var string
     */
    protected $_idFieldName = 'sku';

    protected $_isPkAutoIncrement = false;

    /**
     * Define resource model.
     */
    const YOUR_TABLE = 'custom_table';

    protected $helper; public function __construct(
        \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory,
        \Psr\Log\LoggerInterface $logger,
        \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy,
        \Magento\Framework\Event\ManagerInterface $eventManager,
        \Magento\Store\Model\StoreManagerInterface $storeManager,
        \Magento\Framework\DB\Adapter\AdapterInterface $connection = null,
        \Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource = null,
        \Vendor\Module\Helper\Data $helper
    ) {

        $this->storeManager = $storeManager;
        $this->helper = $helper;

        parent::__construct(
            $entityFactory,
            $logger,
            $fetchStrategy,
            $eventManager,
            $connection,
            $resource
        );
    }

    protected function _construct()
    {
        $this->_init('Vendor\Module\Model\Post', 'Vendor\Module\Model\ResourceModel\Post');
    }

    protected function _initSelect()
    {
        parent::_initSelect();

        $area = $this->helper->getArea();

        if ($area == 'adminhtml') {

             $redirectUrl = $this->helper->getCurrentProduct();
             $this->getRequest()->getParam('id');
             $attributeUrl = explode("/", $redirectUrl);
             $productId =  '23';
             $product = $this->helper->getLoadProduct($productId);
             $sku = $product->getSku();
             $customtag = $product->getCustomtags();
             $customtagsarr = explode("|",$customtag);
             $customvalues = "'" . implode ( "', '", $customtagsarr ) . "'";
            $this->getSelect()->orwhere("main_table.customtags IN($customvalues)");
        } else {
            $this->getSelect();
        }
    }
}


texts: Understanding setSelect()->join Need to join two custom collections

texts:
I am confused understanding the correct usage of $collection->getSelect()->join(... to bring two custom model resources together.  I tried following other examples using the getSelect method.  I also attempted to join the tables in the collection class _afterLoad() method.  I'm stuck with errors like:

  Column not found: 1054 Unknown column 'machinemanager_machine_metertype.meter_type_id' in 'on clause', query was: SELECT main_table., table_alias. FROM machinemanager_machine_meter AS main_table INNER JOIN machinemanager_machine_metertype AS table_alias ON machinemanager_machine_metertype.meter_type_id = machinemanager_machine_meter.meter_type

Here is my simple request.  My model resources to join:

Mage::getModel('machinemanager/machine_meter') //main table 'meter_id' is foreign key
Mage::getModel('machinemanager/machine_metertype') //table to join

So I can understand as a simple example, I'd like to end up with $collection as all fields of both machine_meter and machine_meter_type tables.

Could you please show me how to end up with a correct use of $collection->getSelect()->join(...?  Thank you!


texts:
Kindly i need to know how you want the price to be written exactly: as exemple;  if i have a price should i write it as 14.545,45?

Note: i want to add this format of price in product admin panel.


texts: Wrong Shipping total using Flat Fixed Per Item prices

texts:
I've been searching for a solution to this. Basically what is happening here is each item in the inventory has it's own shipping price set.

When these items are added to a cart, the shipping is calculated and returned by the model shipping/carrier_flatrate, then added to an array.

I can't seem to find where this is totaled up. I've heard that the arrays can be sorted wrong in some cases, however, this seems to be a different situation causing this entirely. Any ideas are greatly appreciated.

I've been searching Google for days trying to make sense of this.


texts: Magento2: Custom block data not showing on frontend side

texts:
I have created a simple module. But block data not display front end.

please find the below code

Block

<?php
namespace Codism\Csr\Block\Index;
class Additional_Csr extends \Magento\Framework\View\Element\Template
{
    public function __construct(\Magento\Framework\View\Element\Template\Context $context)
    {
        parent::__construct($context);
    }

    public function showCustomView()
    {
        return __('Hello Magento 2');
    }
}

Controller

<?php
namespace Codism\Csr\Controller\Index;

class Index extends \Magento\Framework\App\Action\Action
{
    protected $_pageFactory;
    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $pageFactory)
    {
        $this->_pageFactory = $pageFactory;
        return parent::__construct($context);
    }

    public function execute()
    {
        return $this->_pageFactory->create();
    }
}

Layout

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
       <referenceContainer name="content">
           <block class="Codism\Csr\Block\Index\Additional_Csr" name="custom_view" template="Codism_Csr::additional_csr.phtml" />
       </referenceContainer>
</page>

View

<span style="font-weight: 400;"><?php echo $block->showCustomView(); ?> </span>

Route

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="standard">
        <route id="csr" frontName="csr">
            <module name="Codism_Csr" />
        </route>
    </router>
</config>


texts: When I try to get quote shipping address, it returns customer default address. Does the quote session not updated with value in the table?

texts:
When I try to get quote shipping address, it returns customer default address instead of returning from my quote_address table.

I'm trying to pre-populate checkout fields with quote address details. So trying to get $this->getQuote()->getShippingAddress()  When I put getData() it gives all the values from quote_address tables but the address details like firstname, lastname, street are different from table data.
This details fetched from customer default shipping address. Anybody facing this kind of issue?


texts: How to change category location block in magento 1.8?

texts: Is it possible to exchange positions of the list of categories and the price filter in the left sidebar:


texts: I want to add "natural sorting" functionality to Magento admin grid. I would like to understand how the Magento handles admin grid sorting so I know where to start. What functions/files etc. does Magento use to determine the order of values in the admin panel?


texts: Theme logo not changing in magento 2 custom theme

texts:
I had created custom theme in Magento 2 and parent theme as Magento/blank. In my custom theme I have changed logo for my theme. I had declared the theme logo in the app/design/frontend/Prasan/Sanku/layout/default.xml

<?xml version="1.0" encoding="UTF-8"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="logo">
            <arguments>
                <argument name="logo_file" xsi:type="string">images/logo_new.png</argument>
                <argument name="logo_img_width" xsi:type="number">300</argument>
                <argument name="logo_img_height" xsi:type="number">300</argument>
            </arguments>
        </referenceBlock>
    </body>
</page>

After writing this code I had cleared following files var/cache , var/generation, var/view_preprocessed and even pub/static/ but still the theme logo not changed.

I had uploaded logo_new.png at app/design/frontend/Prasan/Sanku/web/images/


texts: I need help in Button animation in magento. I simply want my Add to cart button will change when user clicks on the button. Just like http://www.localbanya.com/. When any user will click on add to cart button on catalog page, the button text will be changed as "1 item added to cart". How do I do it. Please help.


texts: find controller that loads particular phtml file

texts:
im new to this, where can i find the php controller code that loads the following template file in:

<reference name="product.info.options.wrapper">
    <block type="catalog/product_view_type_configurable" name="product.info.options.configurable" as="options_configurable" before="-" template="catalog/product/view/type/options/configurable.phtml"/>
</reference>


texts: Customers not able to register in magento 2.3.1 with error as "The customer email is missing. Enter and try again"

texts:
I am using magento 2.3.1 and i am trying to register customer from frontend and i am getting following error "The customer email is missing. Enter and try again."

when i try to check in _beforeSave() from Magento\Customer\Model\ResourceModel\Customer doesnt getting email id. I am getting following error when I print the customer object

Array
(
    [created_in] => The XXXXXX XXXXX Store
    [email] =>
    [firstname] => pradeep
    [lastname] => sanku
    [store_id] => 1
    [website_id] => 1
    [addresses] => Array
        (
        )

    [entity_id] =>
    [password_hash] => c230dfa79aedee32b5d1d4645977a806be7bb4bfd0689c120930bdb1a45c2e6e:w4cmFyPTPkTsTYTlH0vSOMQIjNzW3kFJ:1
    [parent_id] => 0
)

Note:- I had debugged more and landed at Magento\Customer\Model\AccountManagement.php :: public function createAccount(CustomerInterface $customer, $password = null, $redirectUrl = '')

in this function $customerEmail = $customer->getEmail(); this variable is coming empty.


texts: How to create a custom Filter directive (e.g. for emails)?

texts:
Depending on a custom order's attribute, we would like to slightly adapt the emails for the new order confirmations.

Therefor, we try to implement a new equals directive in Magento\Framework\Filter\Template (we extend this class in a custom module, of course). This directive should take two parameters and evaluate whether these values are equal. Magento's build in if directive only checks, if the given parameter is not equal an empty string.

For example:

{{equals value1 value2}}The two parameters are equal.{{else}}The two parameters are NOT equal.{{/equals}}

We added the following constant to our custom Template.php:

const CONSTRUCTION_EQUALS_PATTERN = '/{{equals\s*(.*?)}}(.*?)({{else}}(.*?))?{{\\/equals\s*}}/si';

The value of this constant is the same as the value of the CONSTRUCTION_IF_PATTERN constant, except we replaced both if with equals.

Furthermore, we override the filter($value) function of the original Template and teach this function to execute a new callback named equalsDirective, if one of the given values matches to above defined pattern.

foreach ([
  self::CONSTRUCTION_DEPEND_PATTERN => 'dependDirective',
  self::CONSTRUCTION_IF_PATTERN => 'ifDirective',
  self::CONSTRUCTION_TEMPLATE_PATTERN => 'templateDirective',
  self::CONSTRUCTION_EQUALS_PATTERN => 'equalsDirective' // this is interesting line
] as $pattern => $directive)

The function equalsDirective just should write a debug message, when it's got called.

Additionally, we adapt the template for the new orders confirmation emails (Magento\Sales\view\email\order_new.html) by adding the following beneath the greeting:

{{equals order.checkout_type request}}This is a request.{{else}}This is an order.{{/equals}}

The problem is, the equalsDirective function never gets called. The given values of the filter function do not contain the above equals directive. Thus, a pattern -- as defined above -- never is found.

We also verified that {{var order.checkout_type}} returns the correct value. Surprisingly, this is not part of the given values of the filter function, as well. But its value is correctly rendered in the email that we received.

Has someone an idea what we missed? Do we have to declare the directives that are parsed from the email templates somewhere else?

We appreciate any help :)

FYI: Couple of years ago we did the same in Magento 1 and it was working fine.


texts: Magento Coupons limit per use o per customer not working

texts:
In the screenshot you can see my options.

I have created a coupon to have the free first shippings.

What i need is to have one unique code (Example: FREEFIRSTSHIPPING) that can be used only one time, but that every logged customers can use this same code one time.

The code works well, setting my Uses per Coupon value to 0, but i have noticed that i can use this code unlimited times, and this is wrong.

Is it a Magento 1.9 bug? Or am i doing something wrong?

PS: I have no coupons related extensions installed.


texts:
I have download and upload custom font in backend:

After save in editor I not see this font name:

Anyone help how can I use this font ?

@update

I solve issue in this way. After upload font:

Text with your font


texts:
Is there a way to change the directory that M2 uses as image cache to something other than /pub/media/catalog/product/cache ?

I'm using Magento 2.2.3 at the moment.


texts:
i am doing several custom modules in Magento 2.
It is a good practice do all the thing orientated to API (thinking in be consume for an mobile app for example ) and also use those api internally in the view model?
Or should i create a controller for return json to the view model and API just for external calls?
For example, i want to show a popup with a list of products using KOjs.
should i use a controller to return the products of that AJAX call o can i use the magento 2 API "rest/V1/products"


texts:
I will be involved in Mobile Application development for the first time and i don't have much exposure to Magento API. Our client wants a Mobile App to be built for Android, Iphone and Windows.

The requirements for the mobile app are as follows:

  1) User LOGIN AND REGISTRATION

  2) Connect with social media

  3) Promotions: Promotional banner slider

  4) Featured Categories:
  Offer/Special categories with see all option and Scrollable products
  under categories

  5) SHOP LOCATOR

  6) Category Listing

  7) Product Listing

  8) Sort Option

  9) Popular Products, Special Offer Blocks

  10) Navigation Filters

  11) Real time product search

  12) Item Listing

  13) PRODUCT DETAIL with all product details and wishlist option

  14) Review Product and Ratings

  15) Add to chart and checkout functionality

  16) Promotional Coupon

  17) Gift Cards

  18) Reward Points

I did a research on SOAP VS REST. Rest only provides the basic feature which is not enough to make an application with above functionality but on the other hand it is faster than SOAP.

Whereas SOAP has almost all the features listed above. Our client needs to make an app based on REST API.

Is it possible to use the combination of REST and SOAP API to build a mobile app? Can i use REST for Product listing, customer creations etc and use SOAP for rest of the feature?

Also, If it is not possible to used them together which would be better option to use SOAP which has many features or create a custom REST API where needed?

It would be great if anyone can provide some insight on this


texts: Stop a xml block from displaying unless called in phtml file

texts:
ok we're running several affiliate networks and we don't want to end up paying 2 lots of commission in case the customer has been through 2 separate networks affiliate. As such we have a 'last source' custom cookie that's created so when we get to checkout/success.phtml it will only display 1 lot of conversion tracking code.

all our tracking codes are setup in separate .phtml files to keep success.phtml as clean as possible.

On our 'success.phtml' we have this code:

if (isset($_COOKIE['cookie_name'])):

if($_COOKIE['cookie_name'] == 'Affiliate1'):
    echo $this->getAffiliateOne();
elseif($_COOKIE['cookie_name'] == 'Affiliate2'):
    echo $this->getAffiliateTwo();
endif;

// Do Both Tracking Codes
else:
echo $this->getAffiliateOne();
echo $this->getAffiliateTwo();
endif;

and our checkout.xml says:

<checkout_onepage_success translate="label">
    <label>One Page Checkout Success</label>
    <reference name="root">
        <action method="setTemplate"><template>page/1column.phtml</template></action>
    </reference>
    <reference name="content">
        <block type="checkout/onepage_success" name="checkout.success" template="checkout/success.phtml">

        <block name="affiliate_one" template="checkout/tracking/affiliate_one_tracking.phtml" type="checkout/onepage_success" /><!-- Affiliate 1 -->
    <block name="affiliate_two" template="checkout/tracking/affiliate_two_tracking.phtml" type="checkout/onepage_success"/><!-- Affiliate 2 -->

 </block>
    </reference>

how ever even though the cookie part is working it seems to auto display both tracking codes. I've tested it by removing all the phtml additions and it still displays all the tracking code regardless. What do i need to do to the checkout.xml so it make sure it only displays the block if it's requested for in the phtml file?


texts: Magento Default Free Shipping not working with cart rule

texts:
I have Enabled free shipping from the admin.

Create shopping cart rule for apply freeshipping only if these condition are true.

But it display for all.

I just want to free shipping only when cart price rule apply.

any help would be much appreciate.


texts: Magento 2 : success messages are not showing

texts:
I am trying to add success message in my controller but messages are showing.

In my controller class, I have extended \Magento\Framework\App\Action\Action class and using below code to add success message:

$this->messageManager->addSuccess(
    __('Thanks for contacting us with your comments and questions. We\'ll respond to you very soon.')
);


texts: Extend multiple classes from single helper

texts:
I have installed two third-party modules and one local module. I want to rewrite/ extend the Helper/Data.php of both third-party modules. Currently, I'm trying to do this from my local module's Helper/Data.php.

My question, is it possible to have my single Helper/Data.php extend both of the third-party helpers? So far, this is not working. What would be the best approach to this? I know I could fix this by creating another local module to rewrite the other third-party module, but since the functionality is related I'd rather stick to a single local module to accomplish it.

To add some detail, this is my rough setup:

MyCompany_Module/etc/config.xml:

    <helpers>
        <moduleb>
            <rewrite>
                <data>MyCompany_Module_Helper_Data</data>
            </rewrite>
        </moduleb>
        <modulea>
            <rewrite>
                <data>MyCompany_Module_Helper_Data</data>
            </rewrite>
        </modulea>
    </helpers>

and in my module's MyCompany_Module_Helper_Data:

class MyCompany_Module_Helper_Data extends PartyA_ModuleA_Helper_Data
{
   ...
}

class MyCompany_Module_Helper_Data extends PartyB_ModuleB_Helper_Data
{
    ...
}

So I am trying to extend two Helpers from a single Helper, is this possible/ an accepted approach? What is the generally accepted approach? Should I split this into a MyCompany_Module_Helper_Data1 and MyCompany_Module_Helper_Data2, or even MyCompany_Module1_Helper_Data and MyCompany_Module2_Helper_Data

Thanks


texts: SOLVED - How to override email/items.phtml?

texts:
I want to customize the email template and add some more columns.
For now I found out that the "email/items.phtml" seems to be the right file.
In the "sales_email_order_items.xml" are all necessary files. So I tried to override them but the only file I can change is the "email/items/order/default.phtml".
This is current progress:
 1. create the "sales_email_order_items.xml" in my module
 2. override the default.phtml

    <referenceBlock name="sales.email.order.renderers">
        <block class="Magento\Sales\Block\Order\Email\Items\Order\DefaultOrder" as="default" template="email/items/order/default.phtml"/>
    </referenceBlock>

That works for the order items but I can't get to override the table head from "email/items.phtml".


texts: Custom option File upload getting in order

texts:
I have a custom option for image upload on product page I just want to know how can i get this image in customer order.

There is by default functionality which gives you link but it redirect on dashboard but I want to download it.


texts: What is the best approach for using Mixpanel People with Magento?

texts:
Here is the official documentation..
https://mixpanel.com/help/reference/javascript#user-identity

The documentation explains how this works, but I am having trouble figuring out the best way to handle this with Magento. It seems like every way I think to implement it, it makes redundant people definitions.


texts:
My mobile menu just stopped working yesterday. This is a Multi-site install, and its only affecting one site.  There has been no installs, no changes to the the site in a few weeks.  There's no error reports, no logs to indicate any issues.  How to fix a javascript or  jQuery issue?

http://www.ironsightprecision.com/products/firing-pins/

The third error only shows after you try to open the mobile menu.


texts: Magento 1.9.x - I want to join first name and last name in customer grid

texts:
I want to get fullname of customers in magento back-end server.

I already brought the first name in index "NAME" and i want to join the lastname after first name.

  protected function _prepareCollection()

protected function _prepareCollection()
{
    $collection = Mage::getResourceModel('customer/customer_collection')
        ->addNameToSelect()
        ->addAttributeToSelect('name')
        ->addAttributeToSelect('firstname')
        ->addAttributeToSelect('lastname')
        ->addAttributeToSelect('email')
        ->addAttributeToSelect('created_at')
        ->addAttributeToSelect('group_id')
        ->addAttributeToSelect('company')
        ->joinAttribute('billing_postcode', 'customer_address/postcode', 'default_billing', null, 'left')
        ->joinAttribute('billing_city', 'customer_address/city', 'default_billing', null, 'left')
        ->joinAttribute('billing_telephone', 'customer_address/telephone', 'default_billing', null, 'left')
        ->joinAttribute('billing_region', 'customer_address/region', 'default_billing', null, 'left')
        ->joinAttribute('billing_country_id', 'customer_address/country_id', 'default_billing', null, 'left');

    $this->setCollection($collection);

    return parent::_prepareCollection();
}

  protected function _prepareColumns()

$this->addColumn('name', array(
        'header'    => Mage::helper('customer')->__('Name'),
        'index'     => 'firstname'
    ));

How can i combine the first name and last name? Could you let me know. Thank you


texts: How do I remove free shipping after discount code has been applied?

texts:
Having an issue at the moment with free delivery on my site.

It is set that any order over £70 gets Free UK Delivery.

However at the moment we are running a discount code with another client set up. They get 33% discount. Orders that are originally around £85 are being discounted to £56.95 and they are still allowed free delivery at that price. It seems that free delivery uses the subtotal after discount rather than before. Is there a quick fix for this, as it is happening quite a lot.

Actions and conditions images:

I have even got the free shipping set to no and its still allowing free shipping.

Im on version 1.9.2, also any advise on weather this rule is setup correctly would be appreciated.

Ive checked out https://www.demacmedia.com/magento-commerce/mini-tutorial-how-to-solve-the-free-shipping-minimum-subtotal-with-discount-issue/ but thats for an older version and dont think that applies anymore.


texts:
I'm writing a custom router for Magento. Here's a code snippet of what I'm doing in the match() method:

$pathInfo = $request->getPathInfo();
$splitPath = explode('/', $pathInfo);
$category = $splitPath[1];
....
$categoriesCollection->addAttributeToFilter('url_key', array('eq' => $category));

My question is this: is it safe to assume that the underlying models will take care of any SQL injection attacks etc, or should I be worrying about preventing these problems?

Many thanks for any guidance.


texts: How to send an Email confirmation after contact us

texts: When the client uses the contact form, how can I get a confirmation email to the user?


texts: How can I delete customers that never logged in?

texts: I want to clean up my customers. How can I delete customer accounts that have never been logged in to?


texts: How to add extension attributes to Customer entity in Magento2?

texts:
I am trying to add extension attributes to customer entity.

I set extension_attributes.xml as follows:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
    <extension_attributes for="Magento\Customer\Api\Data\CustomerInterface">
        <attribute code="my_attribute" type="Text">
            <join reference_table="my_entity"
                  reference_field="customer_id"
                  join_on_field="entity_id">
                <field>my_entity_attribute</field>
            </join>
        </attribute>
    </extension_attributes>
</config>

The table my_entity exists and it has a column called customer_id and I want to join this field to the entity_id field in the customer_entity table, and add my_entity_attribute value as the ultimate extension attribute to customer.

What am I doing wrong?

To test this, I am doing a GET rest api call to endpoint customers/me and debugging $this->_getExtensionAttributes() inside \Magento\Customer\Model\Data\Customer::getExtensionAttributes(), but it gives null.


texts: Do Billing Agreements even work with Paypal Payflow Pro?

texts:
Is Payflow Pro a second rate payment method or something? I can see Billing Agreement settings for every other payment method EXCEPT Payflow Pro. Even Payflow Link has Billing Agreement Settings.

I've also seen a few modules that list their supported payment methods and everything in Magento is supported with the exception of Payflow Pro.

I've checked the Payflow Pro SDK documentation and recurring billing is supported, but Magento doesn't seem to reflect this..


texts: Magento 2- get cart items for a given product ID

texts:
In Magento 1 it's done like this

$quote = Mage::getSingleton('checkout/cart')->getQuote();

$cartItems = $quote->getItemByProduct($product);

Is it possible in Magento 2?